`var currentPageIndex = [];
Widget get page {
switch (currentPageIndex.length) {
case 0:
return FirstView();
break;
case 1:
return SecondView();
break;
default:
return page;
}
}
@override
Widget build(BuildContext context) {
return GridView.count(
crossAxisCount: 2,
children: List.generate(10, (index) {
return GestureDetector(
onTap: () {
setState(() {
page;
});
},
child: Card(
//semanticContainer: true,
clipBehavior: Clip.antiAliasWithSaveLayer,
elevation: 5,
margin: EdgeInsets.all(20),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20)),
child: Image.asset(images[index]
// fit: BoxFit.fill,
),
),
);
}));
}
}
`