custom_state library

Classes

CustomStateView<S>
Custom view with S state
StateButton
  • Build ElevatedButton 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 ElevatedButton.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();
  • StateOutlinedButton
  • 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();
  • StateProperty<S, T>
    StateProperty with be return T state with S state
    StateTextButton
  • Build TextButton 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 ElevatedButton.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();
  • Enums

    ButtonState

    Mixins

    ButtonStateProperty<T>
    ButtonStateProperty with be return T state with ButtonState
    CustomState<T extends StatefulWidget, S>
    Base custom state with S state for the T StatefulWidget

    Functions

    disable(Set<ButtonState> button) bool
    disable flag
    disableAlpha(Set<MaterialState> material, Set<ButtonState> button) bool
    check for set alpha color

    Typedefs

    PropertyResolver<S, T> = T Function(Set<S> states)
    return T value with the S state
    StateBuilder<T extends StatefulWidget, S> = Widget Function(BuildContext context, Set<S> states, CustomState<T, S> customState)
    return Widget with S state
    StateFunction<T extends StatefulWidget, S> = void Function(CustomState<T, S> customState)
    function with CustomStateMixin for call setCustomState
    StateFutureFunction<S> = Future<S> Function({S? currentState})
    return S state when call