int _currentPageIndex = 0;
Widget get _page {
switch (_currentPageIndex) {
case 0:
return FirstView();
break;
case 1:
return SecondView();
break;
default:
}
}
return GridView.count(
crossAxisCount: 2,
children: List.generate(10, (index) {
return GestureDetector(
onTap: () {
setState(() {
_currentPageIndex = index;
});
},
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,
),
),
);
}));