StateTextButton class

Inheritance

Constructors

StateTextButton({Key? key, required StateFunction<StateTextButton, ButtonState> onTap, required Widget initial, Widget? fail, Widget? success, Widget? loader, ButtonStyle? style, Widget? icon, Widget? disable, Widget? loaderIcon, Widget? failIcon, Widget? successIcon, Widget? disableIcon, Set<ButtonState>? states})
const
StateTextButton.future({Key? key, required StateFutureFunction<Set<ButtonState>> futureOnTab, required Widget initial, Widget? icon, Widget? loaderIcon, Widget? successIcon, Widget? failIcon, Widget? disableIcon, Widget? fail, Widget? success, Widget? loader, Widget? disable, ButtonStyle? style, bool hasState = true})
StateTextButton with states = null and without use global key. The state will be ButtonState.progressing when futureOnTab start and end with ButtonState return in futureOnTab
factory

Properties

disable Widget?
ButtonState.forceDisabled child widget
final
disableIcon Widget?
ButtonState.forceDisabled if use ElevatedButton.icon
final
fail Widget?
ButtonState.fail child widget
final
failIcon Widget?
ButtonState.fail if use TextButton.icon
final
hashCode int
The hash code for this object.
no setterinherited
icon Widget?
default if use TextButton.icon
final
initial Widget
default child widget, in undefine state
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loader Widget?
ButtonState.loader child widget
final
loaderIcon Widget?
ButtonState.progressing if use TextButton.icon
final
onTap StateFunction<StateTextButton, ButtonState>
the function run when press the button
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
states Set<ButtonState>?
states != null with be apply this state, else with be apply with setCustomState function in key
final
style ButtonStyle?
custom style child widget
final
success Widget?
ButtonState.success child widget
final
successIcon Widget?
ButtonState.success if use TextButton.icon
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
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
defaultStyleOf(BuildContext context) ButtonStyle
Default StateTextButton style
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

Static Methods

styleFrom({Color? primary, Color? onSurface, Color? backgroundColor, Color? shadowColor, double? elevation, TextStyle? textStyle, EdgeInsetsGeometry? padding, Size? minimumSize, Size? fixedSize, Size? maximumSize, BorderSide? side, OutlinedBorder? shape, MouseCursor? enabledMouseCursor, MouseCursor? disabledMouseCursor, VisualDensity? visualDensity, MaterialTapTargetSize? tapTargetSize, Duration? animationDuration, bool? enableFeedback, AlignmentGeometry? alignment, InteractiveInkFeatureFactory? splashFactory, Color? success, Color? fail, Color? disable}) ButtonStyle
like ElevatedButton.styleFrom with state color for background success, fail