Category Browser

Loading preview

Starting the Flutter app

Grid of category cards with icon and label

Get the source

Add it to your project

Copies the Dart source into your app, so you own it. Flutter SDK only, no extra packages.

First time? Run dart pub global activate fluttertemplates_dev, or read the CLI guide.

How it works

Six tiles from _categories fill a fixed two-column GridView.builder, each one an Icon above a label. An InkWell gives every tile a ripple, and a tap passes the name to onCategorySelected, or shows a demo SnackBar without it. The column count stays at two on any screen width.

Adapting it

  • Navigate from onCategorySelected to your product listing route, using a category id for real data.
  • Replace _categories with an API response; if categories have artwork, swap the Icon for Image.network.
  • Make crossAxisCount depend on width, or use SliverGridDelegateWithMaxCrossAxisExtent, so tablets don’t get two huge tiles per row.