Setup on click action on GridView items

This commit is contained in:
Nishant Srivastava
2019-11-15 00:56:03 +01:00
parent 34747b99ab
commit 034178da5b

View File

@ -1,8 +1,13 @@
import 'package:flutter/material.dart';
class MyGridView {
Card getStructuredGridCell(name, image) {
return Card(
GestureDetector getStructuredGridCell(name, image) {
// Wrap the child under GestureDetector to setup a on click action
return GestureDetector(
onTap: () {
print("onTap called.");
},
child: Card(
elevation: 1.5,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
@ -14,7 +19,8 @@ class MyGridView {
child: Text(name),
)
],
));
)),
);
}
GridView build() {