CupertinoActionSheet class
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.
To create a local project with this code sample, run:
flutter create --sample=cupertino.CupertinoActionSheet.1 mysample
See also:
- CupertinoActionSheetAction, which is an iOS-style action sheet button.
- developer.apple.com/design/human-interface-guidelines/ios/views/action-sheets/
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- CupertinoActionSheet
Constructors
-
CupertinoActionSheet({Key? key, Widget? title, Widget? message, List<
Widget> ? actions, ScrollController? messageScrollController, ScrollController? actionScrollController, Widget? cancelButton}) -
Creates an iOS-style action sheet.
const
Properties
-
actions
→ List<
Widget> ? -
The set of actions that are displayed for the user to select.
final
- actionScrollController → ScrollController?
-
A scroll controller that can be used to control the scrolling of the
actions in the action sheet.
final
- cancelButton → Widget?
-
The optional cancel button that is grouped separately from the other
actions.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- message → Widget?
-
An optional descriptive message that provides more details about the
reason for the alert.
final
- messageScrollController → ScrollController?
-
A scroll controller that can be used to control the scrolling of the
message in the action sheet.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- title → Widget?
-
An optional title of the action sheet. When the message is non-null,
the font of the title is bold.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< CupertinoActionSheet> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited