Skip to content

Instantly share code, notes, and snippets.

@kirshiyin89
Created August 24, 2020 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirshiyin89/04ebf5c874699fdee56966454ab3e5ae to your computer and use it in GitHub Desktop.
Save kirshiyin89/04ebf5c874699fdee56966454ab3e5ae to your computer and use it in GitHub Desktop.
Snippet for displaying the GridView.
Widget _buildGridView(BuildContext context, List<ServerInfo> serverInfo) {
return GridView.count(
primary: false,
padding: const EdgeInsets.all(1.5),
crossAxisCount: determineCrossAxisCount(context),
childAspectRatio: 1.2,
mainAxisSpacing: 1.0,
crossAxisSpacing: 1.0,
children: _prepareServerInfoCards(serverInfo), //new Cards()
shrinkWrap: true,
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment