Closed ysnsyhn closed 4 years ago
Wrap your grid item with GestureDetector.
i.e
GestureDetector(
onTap: () {
print("onTap called.");
},
child: Text("Hello World"),
),
Commit with change: https://github.com/nisrulz/flutter-examples/commit/034178da5b77174bc9d66ec9ce412c685ee82978
Forgot to mention, you can also use InkWell class which will enable ripple effect.
InkWell (
onTap: () {
print("onTap called.");
},
child: Text("Hello World"),
),
Depending on your use case, use either InkWell
or GestureDetector
Read more : https://api.flutter.dev/flutter/material/InkWell-class.html
how to make the grids clickable? I try to change to another layout when one of the items is clicked.