Listings Grid

Loading preview

Starting the Flutter app

A Flutter marketplace listings grid with category filters, prices, and favourite buttons.

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

Seven const _Listing items fill a two-column GridView.count. Each has a category, and _visibleItems filters them by the selected ChoiceChip, with All showing everything. Favorites work too: _faved holds listing titles toggled by the heart button, so they survive filtering, starting with Road bike selected. The search button shows a demo SnackBar, and cards aren’t tappable.

Adapting it

  • Key _faved by listing ID, because titles can repeat in real data.
  • Fetch _items from your API, and call it again when _filter changes if filtering is server-side.
  • Show an empty state when a category has no items.