FDialog.adaptive constructor

FDialog.adaptive({
  1. required List<Widget> actions,
  2. FDialogStyle? style,
  3. String? semanticsLabel,
  4. BoxConstraints constraints = const BoxConstraints(minWidth: 280, maxWidth: 560),
  5. Widget? title,
  6. Widget? body,
  7. Key? key,
})

Creates a adaptive FDialog that lays out the actions vertically on FBreakpoints.sm devices and horizontally on larger devices.

Implementation

FDialog.adaptive({
  required List<Widget> actions,
  this.style,
  this.semanticsLabel,
  this.constraints = const BoxConstraints(minWidth: 280, maxWidth: 560),
  Widget? title,
  Widget? body,
  super.key,
}) : builder = ((context, style) => switch (MediaQuery.sizeOf(context).width) {
       final width when width < context.theme.breakpoints.sm => VerticalContent(
         style: style.verticalStyle,
         title: title,
         body: body,
         actions: actions,
       ),
       _ => HorizontalContent(style: style.horizontalStyle, title: title, body: body, actions: actions),
     });