CupertinoAlertDialog class

An iOS-style alert dialog.

An alert dialog informs the user about situations that require acknowledgment. An alert dialog has an optional title, optional content, and an optional list of actions. The title is displayed above the content and the actions are displayed below the content.

This dialog styles its title and content (typically a message) to match the standard iOS title and message dialog text style. These default styles can be overridden by explicitly defining TextStyles for Text widgets that are part of the title or content.

To display action buttons that look like standard iOS dialog buttons, provide CupertinoDialogActions for the actions given to this dialog.

Typically passed as the child widget to showDialog, which displays the dialog.

This sample shows how to use a CupertinoAlertDialog. The CupertinoAlertDialog shows an alert with a set of two choices when CupertinoButton is pressed.

To create a local project with this code sample, run:
flutter create --sample=cupertino.CupertinoAlertDialog.1 mysample

See also:



CupertinoAlertDialog({Key? key, Widget? title, Widget? content, List<Widget> actions = const <Widget>[], ScrollController? scrollController, ScrollController? actionScrollController, Duration insetAnimationDuration = const Duration(milliseconds: 100), Curve insetAnimationCurve = Curves.decelerate})
Creates an iOS-style alert dialog.


actions List<Widget>
The (optional) set of actions that are displayed at the bottom of the dialog.
actionScrollController ScrollController?
A scroll controller that can be used to control the scrolling of the actions in the dialog.
content Widget?
The (optional) content of the dialog is displayed in the center of the dialog in a lighter font.
hashCode int
The hash code for this object.
no setterinherited
insetAnimationCurve Curve
The curve to use for the animation shown when the system keyboard intrudes into the space that the dialog is placed in.
insetAnimationDuration Duration
The duration of the animation to show when the system keyboard intrudes into the space that the dialog is placed in.
key Key?
Controls how one widget replaces another widget in the tree.
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollController ScrollController?
A scroll controller that can be used to control the scrolling of the content in the dialog.
title Widget?
The (optional) title of the dialog is displayed in a large font at the top of the dialog.


createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
createState() State<CupertinoAlertDialog>
Creates the mutable state for this widget at a given location in the tree.
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
toString({DiagnosticLevel minLevel =}) String
A string representation of this object.
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
toStringShort() String
A short, textual description of this widget.


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