Skip to content

Dialog ​

Static helpers over showDialog — an alert (single OK button), a confirmation (Yes/No), and a fully custom dialog for anything else.

View source on GitHub ↗

CLI ​

Install this component into your project:

dialog
$flutter_beautify add dialog

Variants ​

FBDialog.alert() · FBDialog.confirmation() · FBDialog.custom() — .show() and .showCustom() also exist as the lower-level entry points these are built on.

Key parameters ​

ParameterTypeDefault
contextBuildContextrequired
title / messageStringrequired
onPositive / onNegativeVoidCallback?(confirmation)
barrierDismissibleboolfalse (alert) / true (confirmation)

Usage ​

dart
import 'package:your_app/widgets/dialog.dart';

FBDialog.alert(
  context: context,
  title: 'Saved',
  message: 'Your changes have been saved.',
);

Released under the MIT License.