Dialog class

A modal dialog with a title, message, and optional action buttons.

Use showDialog to display. Actions are laid out in a row at the bottom. Pressing Escape dismisses the dialog.

Inheritance

Constructors

Dialog({Key? key, required Widget child, String? title, List<Widget>? actions, EdgeInsets? padding, TextStyle? titleStyle, Color backgroundColor = Colors.white})
Creates a Dialog containing child with optional title and actions.
const

Properties

actions List<Widget>?
Optional action widgets displayed at the bottom of the dialog.
final
backgroundColor Color
The background color of the dialog card.
final
child Widget
The content widget displayed in the dialog body.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another in the tree.
finalinherited
padding EdgeInsets?
Padding around the dialog content.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title String?
An optional title displayed above the content.
final
titleStyle TextStyle?
The text style for the title.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates the Element for this widget.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited