sub_state 2.0.0
sub_state: ^2.0.0 copied to clipboard
A lightweight, type-safe state management helper for Dart and Flutter — model initial, loading, success and failure states with exhaustive pattern matching.
0.0.01 #
- initial release.
1.1.0 #
- add progress in loading
1.2.0 #
- add TError
2.0.0 #
- Rewritten on native Dart 3
sealedclasses —sub_stateis now a pure-Dart package you just add and import. - State variants are now public (
SubInitial,SubLoading,SubSuccess,SubFailure, and theSub2…–Sub5…families), enabling native, exhaustiveswitchpattern matching. - Added
copyWithon the failure variants (previously only on success). - Fix:
SubState3.isFailurenow correctly reports failures (it previously checked the wrong variant type and always returnedfalse). - Same public API as v1 (
when,maybeWhen,whenOrNull,map,maybeMap,mapOrNull, theis*getters,dataOrNull/errorOrNull). - Added a full test suite.
