Dialog
A modal dialog interrupts the user with important content and expects a response.
Preview
CLI
To generate and customize this style:
dart run forui style create dialogUsage
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
Preview
Vertical Layout
We recommend using the vertical layout on mobile devices.
Preview
Blurred Barrier
Preview
Last updated on