solid_x 2.1.3
solid_x: ^2.1.3 copied to clipboard
Inspired by Kotlin's `ViewModel + StateFlow` pattern, Solid provides a clean architecture to manage your application's state with zero code generation and zero boilerplate.
2.1.3 #
- Changed:
emit(S)andPush<S>have been merged into a single method to improve readability and maintainability. - Added:
isDisposedflag for safely determining ViewModel lifecycle state.
2.1.2 #
- Added:
emit(S)helper method onSolid<S>to safely update the primary state without Dart generic inference issues when pushing subclasses. - Added:
onReadyandonDisposecallbacks toSolidProviderandSolidProvider.valueto facilitate firing initial events (like API calls) safely after the first frame renders.
2.1.1 #
- Changed:
initialparameter inMutationBuilderis now optional. If omitted, the mutation is automatically triggered ininitStateand the widget falls back to displaying theloadingbuilder state until the mutation resolves.
2.1.0 #
- Added:
Mutation<T>— a reactive wrapper around async functions that automatically tracksinitial → loading → success / empty / errorlifecycle, with zero manual state management. - Added:
mutation<T>(fn)helper onSolid— throw-based, declares a mutation in one line inside a ViewModel. - Added:
mutationEither<L, T>(fn)helper onSolid— Either-based, compatible withdartzEither<L, R>, Left maps to error state, Right maps to success. - Added:
MutationBuilder<T>widget — renders the correct widget per mutation state with optionalonSuccess/onErrorside-effect hooks andbuildWhenfiltering. - Added:
MutationState<T>sealed class with 5 subtypes:MutationInitial,MutationLoading,MutationSuccess,MutationEmpty,MutationError. - Updated: Example app — new Mutation tab (⚡) demonstrating all mutation variants.
2.0.3 #
- Major Redesign: Solid is now a StateFlow/ViewModel pattern library.
- Added:
SolidViewModel<S>– single-state ViewModel base class withemit(S). - Added:
SolidConsumer<T>– combinesSolidBuilderandSolidListenerin one widget. - Removed: Granular state management (
SolidState,Mutation,Solidbase class). - Simplified: The widget API (
SolidProvider,SolidBuilder,SolidListener) now supports anyChangeNotifier. - Updated: Added
context.solid<T>()extension for easy ViewModel lookup.
1.0.0 #
- Initial release.
- Granular state management with
SolidState<T>andMutation<T>. Solidabstract base class with auto-disposal.- 8 widget variants for state and mutations.