AwaitableIconButton<R> class
Button with indicator display during processing to prevent consecutive hits.
Setting an asynchronous function to onPressed will display an indicator during execution and prevent pressing. whenComplete is executed when onPressed completes without throwing an exception icon specifies the icon to be displayed on the button If executingIcon is specified, the icon can be displayed with the running indicator.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- AwaitableIconButton
Constructors
-
AwaitableIconButton({Key? key, required OnPressed<
R> ? onPressed, WhenComplete<R> ? whenComplete, OnError? onError, Widget? executingIcon, double? iconSize, Color? indicatorColor, Size? indicatorSize, double? indicatorStrokeWidth, Widget? indicator, required Widget icon}) -
Create an AwaitableIconButton.
const
Properties
- executingIcon → Widget?
-
Widget to display while running.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → Widget
-
The icon to display inside the button.
final
- iconSize → double?
-
Size of the IconButton icon.
final
- indicator → Widget?
-
Widget to display as an indicator during asynchronous processing.
Cannot be specified when indicatorColor is specified.
final
- indicatorColor → Color?
-
Indicator color during asynchronous processing.
If null,
color
andcircularTrackColor
ofThemeData.progressIndicatorTheme
are used. Cannot be specified if indicator is specified.final - indicatorSize → Size?
-
Indicator size during asynchronous processing.
Cannot be specified if indicator is specified.
If this field and the
indicator
are null, thenSize.square(24)
is used.final - indicatorStrokeWidth → double?
-
Indicator strokeWidth during asynchronous processing.
Cannot be specified if indicator is specified.
If this field and the
indicator
are null, then4
is used.final - key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onError → OnError?
-
Callback when onPressed throws an exception.
final
-
onPressed
→ OnPressed<
R> ? -
Called when the button is tapped or otherwise activated.
Return values can be used to pass values to whenComplete.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
whenComplete
→ WhenComplete<
R> ? -
Callback when onPressed completes without throwing an exception.
Receive the return value of onPressed.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _AwaitableIconButtonState< R> -
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