AnimatedStateButtonController class

Inheritance

Constructors

AnimatedStateButtonController({Map<StateId, ButtonState>? states, ButtonState? loadingState, void onStateChanged(StateId newStateId)?, Duration autoResetDelay = const Duration(milliseconds: 600)})

Properties

autoResetDelay → Duration
Delay por defecto para volver a init en run* si resetToInit=true.
final
currentState → ButtonState?
no setter
currentStateId → StateId
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
isInit → bool
no setter
isLoading → bool
no setter
loadingState → ButtonState
Estado de carga configurable (si no lo pasas, se autogenera).
final
onStateChanged → void Function(StateId newStateId)?
Callback al cambiar de estado.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
states → Map<StateId, ButtonState>
final
value ↔ StateId
The current value stored in this notifier.
getter/setter pairinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
changeState(StateId id) → void
contains(StateId id) → bool
dispose() → void
Discards any resources used by the object.
inherited
init() → void
loading() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
register(ButtonState state) → void
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
run(AsyncStateTask task, {Duration? stateDelay, bool resetToInit = true}) → Future<void>
Ejecuta una tarea que devuelve el StateId final.
runBool(Future<bool> task(), {StateId successId = 'success', StateId errorId = 'error', Duration? stateDelay, bool resetToInit = true}) → Future<void>
Task booleana → success/error.
runGuarded(Future<void> task(), {StateId successId = 'success', StateId errorId = 'error', Duration? stateDelay, bool resetToInit = true}) → Future<void>
Task que solo puede lanzar o terminar bien → success/error.
safeChangeState(StateId id) → bool
toString() → StateId
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited