CupertinoActionSheet class Null safety

An iOS-style action sheet.

An action sheet is a specific style of alert that presents the user with a set of two or more choices related to the current context. An action sheet can have a title, an additional message, and a list of actions. The title is displayed above the message and the actions are displayed below this content.

This action sheet styles its title and message to match standard iOS action sheet title and message text style.

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

To include a iOS-style cancel button separate from the other buttons, provide an CupertinoActionSheetAction for the cancelButton given to this action sheet.

An action sheet is typically passed as the child widget to showCupertinoModalPopup, which displays the action sheet by sliding it up from the bottom of the screen.

This sample shows how to use a CupertinoActionSheet. The CupertinoActionSheet shows a modal popup that slides in from the bottom when CupertinoButton is pressed.
To create a local project with this code sample, run:
flutter create --sample=cupertino.CupertinoActionSheet.1 mysample

See also:



CupertinoActionSheet({Key? key, Widget? title, Widget? message, List<Widget>? actions, ScrollController? messageScrollController, ScrollController? actionScrollController, Widget? cancelButton})
Creates an iOS-style action sheet. [...]


actions List<Widget>?
The set of actions that are displayed for the user to select. [...]
actionScrollController ScrollController?
A scroll controller that can be used to control the scrolling of the actions in the action sheet. [...]
cancelButton Widget?
The optional cancel button that is grouped separately from the other actions. [...]
hashCode int
The hash code for this object. [...]
@nonVirtual, read-only, inherited
key Key?
Controls how one widget replaces another widget in the tree. [...]
final, inherited
message Widget?
An optional descriptive message that provides more details about the reason for the alert. [...]
messageScrollController ScrollController?
A scroll controller that can be used to control the scrolling of the message in the action sheet. [...]
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
title Widget?
An optional title of the action sheet. When the message is non-null, the font of the title is bold. [...]


build(BuildContext context) Widget
Describes the part of the user interface represented by this widget. [...]
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree. [...]
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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. [...]
@nonVirtual, inherited