Notification Settings

Loading preview

Starting the Flutter app

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

Three booleans, _push, _email and _marketing, each bound to a SwitchListTile. Toggles respond immediately but live only in memory, so they revert to defaults when the page is recreated. Below the divider, Quiet Hours is a static ListTile with a fixed time range and a demo SnackBar on tap.

Adapting it

  • Load initial values in initState, and save from each onChanged to shared_preferences or your API.
  • When _push is switched on, request OS notification permission and revert if it’s denied.
  • Use showTimePicker in the Quiet Hours onTap, then render the stored times.