Здесь ваш модифицированный метод сборки
@override
Widget build(BuildContext context) {
List<Items> myList = [item1, item2, item3, item4, item5, item6];
var color = 0xff616161;
return Flexible(
child: GridView.count(
childAspectRatio: 1.0,
padding: EdgeInsets.only(left: 16, right: 16),
crossAxisCount: 2,
crossAxisSpacing: 18,
mainAxisSpacing: 18,
children: myList.map((data) {
return GridTile(
child: InkResponse(
child: Container(
decoration: BoxDecoration(color: Color(color), borderRadius: BorderRadius.circular(10)),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Image.asset(
data.img,
width: 42,
),
SizedBox(
height: 14,
),
Text(
data.title,
style: GoogleFonts.openSans(textStyle: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w600)),
),
SizedBox(
height: 8,
),
Text(
data.subtitle,
style: GoogleFonts.openSans(textStyle: TextStyle(color: Colors.white38, fontSize: 10, fontWeight: FontWeight.w600)),
),
SizedBox(
height: 14,
),
Text(
data.event,
style: GoogleFonts.openSans(textStyle: TextStyle(color: Colors.white70, fontSize: 11, fontWeight: FontWeight.w600)),
),
],
),
),
onTap: () {
// Handle On Tap
},
),
);
}).toList()),
);
}
Другой способ использования InkWell
@override
Widget build(BuildContext context) {
List<Items> myList = [item1, item2, item3, item4, item5, item6];
var color = 0xff616161;
return Flexible(
child: GridView.count(
childAspectRatio: 1.0,
padding: EdgeInsets.only(left: 16, right: 16),
crossAxisCount: 2,
crossAxisSpacing: 18,
mainAxisSpacing: 18,
children: myList.map((data) {
return InkWell(
onTap: (){
// Handle On Tap
},
child: Container(
decoration: BoxDecoration(color: Color(color), borderRadius: BorderRadius.circular(10)),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Image.asset(
data.img,
width: 42,
),
SizedBox(
height: 14,
),
Text(
data.title,
style: GoogleFonts.openSans(textStyle: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w600)),
),
SizedBox(
height: 8,
),
Text(
data.subtitle,
style: GoogleFonts.openSans(textStyle: TextStyle(color: Colors.white38, fontSize: 10, fontWeight: FontWeight.w600)),
),
SizedBox(
height: 14,
),
Text(
data.event,
style: GoogleFonts.openSans(textStyle: TextStyle(color: Colors.white70, fontSize: 11, fontWeight: FontWeight.w600)),
),
],
),
),
);
}).toList()),
);
}