Skip to Content
Forui 0.17.0 is released 🎉
DocumentationOverlayDialog

Dialog

A modal dialog interrupts the user with important content and expects a response.

CLI

To generate and customize this style:

dart run forui style create dialog

Usage

showFDialog(...)

showFDialog<T>( context: context, builder: (context, style, animation) => FDialog(...), useRootNavigator: false, routeStyle: (style) => style.copyWith(...), style: (style) => style.copyWith(...), barrierLabel: 'Label', barrierDismissible: true, routeSettings: RouteSettings(...), anchorPoint: Offset.zero, useSafeArea: false, );

FDialog(...)

FDialog( style: (style) => style.copyWith(...), animation: animation, semanticsLabel: 'Dialog', constraints: BoxConstraints(minWidth: 280, maxWidth: 560), direction: Axis.horizontal, title: const Text('Title'), body: const Text('Body'), actions: [ FButton(style: FButtonStyle.outline(), child: const Text('Cancel'), onPress: () {}), FButton(child: const Text('Continue'), onPress: () {}), ], );

FDialog.adaptive(...)

FDialog.adaptive( style: (style) => style.copyWith(...), animation: animation, semanticsLabel: 'Dialog', constraints: BoxConstraints(minWidth: 280, maxWidth: 560), title: const Text('Title'), body: const Text('Body'), actions: [ FButton(style: FButtonStyle.outline(), child: const Text('Cancel'), onPress: () {}), FButton(child: const Text('Continue'), onPress: () {}), ], );

FDialog.raw(...)

FDialog.raw( style: (style) => style.copyWith(...), animation: animation, semanticsLabel: 'Dialog', constraints: BoxConstraints(minWidth: 280, maxWidth: 560), builder: (context, style) => const Placeholder(), );

Examples

Horizontal Layout

Vertical Layout

We recommend using the vertical layout on mobile devices.

Blurred Barrier

Last updated on