Notification Center

Loading preview

Starting the Flutter app

A showcase of Flutter's notification center 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

_notifications is a const list where each entry has a read flag, copied into the _read set. Unread entries get a tinted Card and blue icon; read entries use grey. Those grey values are hardcoded, including a light Colors.grey[300] that sits oddly on dark surfaces. Mark all read fills _read and then disables itself, and tapping a row marks it read and shows a demo SnackBar.

Adapting it

  • Load _notifications from your endpoint.
  • Send Mark all read to your API as a batch call alongside the local update.
  • Swap the Colors.grey shades for colorScheme roles, and compute time from a timestamp.