Created
June 5, 2021 22:34
-
-
Save VB10/7a4529824a676f58f36280259d379573 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar(), | |
body: buildGridViewBody(), | |
); | |
} | |
GridView buildGridViewBody() { | |
return GridView.builder( | |
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2), | |
itemCount: items.length, | |
shrinkWrap: true, | |
itemBuilder: (context, index) => ItemCard(onPressed: () => navigateToDetail(index), model: items[index]), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment