Dialogs

Loading preview

Starting the Flutter app

Confirmation, input, multi-choice, loading, and custom dialogs

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

Four dialogs from showDialog, each awaited so its result appears in the Last result tile. _NameDialog owns its TextEditingController and disposes it after the closing animation, and _MultiChoiceDialog keeps a Set of CheckboxListTile choices until Done. _showLoadingDialog is a mock: Future.delayed closes it after two seconds, with barrierDismissible: false blocking outside taps and PopScope blocking back, so the timed pop can’t close the page.

Adapting it

  • Act on each awaited result instead of calling _showResult.
  • Replace Future.delayed with your real request, popping the dialog in a finally.
  • Pass the options into _MultiChoiceDialog as a parameter.