Restaurant Review

Loading preview

Starting the Flutter app

A showcase of Flutter's restaurant review functionality

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

A summary header sits above a ListView.builder of _reviews. The header is fixed: 4.5, 128 and the star row are literals, and List.generate always draws four full stars plus a star_half. Each review card shows an initial in a CircleAvatar and as many stars as its rating, with no outlines for the rest. Write Review shows a demo SnackBar.

Adapting it

  • Use aggregates from your API for the header, and pick Icons.star_half from the actual average.
  • Open a rating form from the Write Review button, then refresh _reviews.
  • (r['user'] as String)[0] throws on an empty name, so guard it for anonymous reviewers.