finite_state_widget 0.0.3
finite_state_widget: ^0.0.3 copied to clipboard
Declarative FSM-driven widgets with optional controllers (MVC/MVVM style) and an easy map-based UI per-state.
Changelog #
All notable changes to this project will be documented in this file.
The format loosely follows Keep a Changelog and the project adheres to Semantic Versioning.
0.0.3 - 2026-03-21 #
Added #
rebuild()protected method onFiniteState— re-renders the current state's widget without changing FSM state. Useful when controller data changed but the FSM state remains the same. Does not fireonEnter/onExit/onSelfTransitionhooks.rebuild()protected method onFiniteStateController— delegates toFiniteState.rebuild(). Enables true MVC separation: the controller mutates data and callsrebuild(), with no glue logic needed in the State.
0.0.2 - 2026-03-04 #
Changed #
- BREAKING: Renamed
FiniteState.stategetter tocurrentStatefor consistency withFiniteStateController.currentStateand to avoid ambiguity with Flutter'sState<T>class.
Added #
buildCurrentState()protected method onFiniteState— returns the widget for the current state (with fallback). Useful for testing.switcherDurationoverridable getter onFiniteState— customizeAnimatedSwitcherduration (default: 180 ms). UseDuration.zeroto disable animation.- README: documented
FiniteStateWidgetas a third primitive alongsideStatelessWidgetandStatefulWidget. - Widget tests covering: initial render, dispatch transitions, fallback for unmapped state, lifecycle hooks, invalid transitions, custom
switcherDuration.