Skip to content
On this page

Dialog

A modal surface for a focused decision or interaction.

Dialog in FluttyUIDialog in FluttyUI dark theme

Import

import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;

Usage

Call this from a callback with a context below FluttyApp, which provides the overlay.

ui.Dialog.show(
  context: context,
  title: const Text('Welcome'),
  child: const Text('Your workspace is ready.'),
)

API Reference

The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.

Dialog

const Dialog({
  super.key,
  this.size,
  this.title,
  this.description,
  this.actions = const [],
  required this.child,
  this.icon,
  this.onClose,
  this.padding,
  this.backgroundColor,
  this.foregroundColor,
  this.textStyle,
  this.borderRadius,
  this.maxWidth = 420,
});
ParameterTypeRequiredDefault
keyKey?Nonull
sizeComponentSize?Nonull
titleWidget?Nonull
descriptionWidget?Nonull
actionsList<Widget>Noconst []
childWidgetYes—
iconWidget?Nonull
onCloseVoidCallback?Nonull
paddingEdgeInsetsGeometry?Nonull
backgroundColorColor?Nonull
foregroundColorColor?Nonull
textStyleTextStyle?Nonull
borderRadiusdouble?Nonull
maxWidthdoubleNo420

Future<T?> show<T>

static Future<T?> show<T>({
  required BuildContext context,
  ComponentSize? size,
  Widget? title,
  Widget? description,
  List<Widget> actions = const [],
  required Widget child,
  Widget? icon,
  VoidCallback? onClose,
  EdgeInsetsGeometry? padding,
  Color? backgroundColor,
  Color? foregroundColor,
  TextStyle? textStyle,
  double? borderRadius,
  double maxWidth = 420,
  bool barrierDismissible = true,
  DialogMotion? motion,
});

Application Setup

Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.

Source

lib/src/widgets/overlays/dialog/dialog.dart

This reference is generated from the Dialog declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

DartFlutter

Get started with FluttyUI