solid_x 2.1.3 copy "solid_x: ^2.1.3" to clipboard
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) and Push<S> have been merged into a single method to improve readability and maintainability.
  • Added: isDisposed flag for safely determining ViewModel lifecycle state.

2.1.2 #

  • Added: emit(S) helper method on Solid<S> to safely update the primary state without Dart generic inference issues when pushing subclasses.
  • Added: onReady and onDispose callbacks to SolidProvider and SolidProvider.value to facilitate firing initial events (like API calls) safely after the first frame renders.

2.1.1 #

  • Changed: initial parameter in MutationBuilder is now optional. If omitted, the mutation is automatically triggered in initState and the widget falls back to displaying the loading builder state until the mutation resolves.

2.1.0 #

  • Added: Mutation<T> — a reactive wrapper around async functions that automatically tracks initial → loading → success / empty / error lifecycle, with zero manual state management.
  • Added: mutation<T>(fn) helper on Solid — throw-based, declares a mutation in one line inside a ViewModel.
  • Added: mutationEither<L, T>(fn) helper on Solid — Either-based, compatible with dartz Either<L, R>, Left maps to error state, Right maps to success.
  • Added: MutationBuilder<T> widget — renders the correct widget per mutation state with optional onSuccess/onError side-effect hooks and buildWhen filtering.
  • 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 with emit(S).
  • Added: SolidConsumer<T> – combines SolidBuilder and SolidListener in one widget.
  • Removed: Granular state management (SolidState, Mutation, Solid base class).
  • Simplified: The widget API (SolidProvider, SolidBuilder, SolidListener) now supports any ChangeNotifier.
  • Updated: Added context.solid<T>() extension for easy ViewModel lookup.

1.0.0 #

  • Initial release.
  • Granular state management with SolidState<T> and Mutation<T>.
  • Solid abstract base class with auto-disposal.
  • 8 widget variants for state and mutations.
1
likes
160
points
290
downloads

Publisher

unverified uploader

Weekly Downloads

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.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on solid_x