FDialog constructor
FDialog({})
Creates a FDialog with a title, subtitle, and possible actions.
The semanticLabel
defaults to title
if it is not provided.
The direction
determines the layout of the actions. It is recommended to use Axis.vertical on smaller devices,
such as mobile phones, and Axis.horizontal on larger devices, such as tablets and desktops.
The Axis.vertical layout with two possibles actions is:
|--------------------|
| [title] |
| |
| [body] |
| |
| [first action] |
| [second action] |
|--------------------|
The Axis.horizontal layout with two possibles actions is:
|--------------------------------------------|
| [title] |
| |
| [body] |
| |
| [first action] [second action] |
|--------------------------------------------|
Implementation
FDialog({
required List<Widget> actions,
this.style,
this.insetAnimationDuration = _defaultDuration,
this.insetAnimationCurve = Curves.decelerate,
this.semanticLabel,
Widget? title,
Widget? body,
Axis direction = Axis.vertical,
super.key,
}) : builder = switch (direction) {
Axis.horizontal => (context, style) => HorizontalContent(
style: style.horizontalStyle,
title: title,
body: body,
actions: actions,
),
Axis.vertical => (context, style) => VerticalContent(
style: style.verticalStyle,
title: title,
body: body,
actions: actions,
),
};