sub_state 2.0.0 copy "sub_state: ^2.0.0" to clipboard
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 sealed classes — sub_state is now a pure-Dart package you just add and import.
  • State variants are now public (SubInitial, SubLoading, SubSuccess, SubFailure, and the Sub2…Sub5… families), enabling native, exhaustive switch pattern matching.
  • Added copyWith on the failure variants (previously only on success).
  • Fix: SubState3.isFailure now correctly reports failures (it previously checked the wrong variant type and always returned false).
  • Same public API as v1 (when, maybeWhen, whenOrNull, map, maybeMap, mapOrNull, the is* getters, dataOrNull / errorOrNull).
  • Added a full test suite.
2
likes
160
points
221
downloads
screenshot

Documentation

Documentation
API reference

Publisher

verified publisheralghanem4it.com

Weekly Downloads

A lightweight, type-safe state management helper for Dart and Flutter — model initial, loading, success and failure states with exhaustive pattern matching.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

collection, meta

More

Packages that depend on sub_state