StateOutlinedButton class
- Build OutlinedButton with decoration change follow state
- onTap the function run when press the button
- initial is default child widget, in undefine state
- fail, success, loader will show in ButtonState.fail, ButtonState.success and ButtonState.progressing
- style use StateButton.styleFrom for custom style, null with be use theme style or default
- icon is default if use OutlinedButton.icon
- failIcon, successIcon, loaderIcon will be replace the icon field in the corresponding state ButtonState.fail, ButtonState.success and ButtonState.progressing
- states != null with be apply this state, else with be apply with setCustomState function in key
- for define key: final GlobalKey<CustomStateMixin<StateButton, ButtonState>> stateButtonKey = GlobalKey();
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- StateOutlinedButton
Constructors
-
StateOutlinedButton({Key? key, required StateFunction<
StateOutlinedButton, ButtonState> onTap, required Widget initial, Widget? fail, Widget? success, Widget? loader, Widget? disable, ButtonStyle? style, Widget? icon, Widget? loaderIcon, Widget? failIcon, Widget? successIcon, Widget? disableIcon, Set<ButtonState> ? states}) -
const
-
StateOutlinedButton.future({Key? key, required StateFutureFunction<
Set< 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})ButtonState> > -
StateOutlinedButton with states = null
and without use global key.
The state will be ButtonState.progressing when
futureOnTab
start and end with ButtonState return infutureOnTab
factory
Properties
- disable → Widget?
-
ButtonState.disabled child widget
final
- disableIcon → Widget?
-
ButtonState.disabled if use ElevatedButton.icon
final
- fail → Widget?
-
ButtonState.fail child widget
final
- failIcon → Widget?
-
ButtonState.fail if use OutlinedButton.icon
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → Widget?
-
default if use OutlinedButton.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 widgetfinal - loaderIcon → Widget?
-
ButtonState.progressing if use OutlinedButton.icon
final
-
onTap
→ StateFunction<
StateOutlinedButton, 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 OutlinedButton.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 StateOutlinedButton 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, BorderSide? successSide, Color? success, BorderSide? failSide, Color? fail, Color? disable, BorderSide? disableSide}) → ButtonStyle -
like OutlinedButton.styleFrom with state color for
foreground
success
,fail
and state color forside
withsuccessSide
,failSide