mvvm_kit library

Classes

DataScope
Manages the lifecycle of ChangeNotifier instances, particularly LiveData.
GroupWatch
Widget that rebuilds when any of multiple LiveData values change.
HotswapLiveData<T>
A LiveData that can dynamically switch between different source LiveData.
LiveData<T>
An observable data holder for the MVVM pattern.
LiveRepositoryData<T>
Repository data backed by an immutable LiveData source.
MutableLiveData<T>
A mutable version of LiveData that allows changing its value.
MutableRepositoryData<T>
Repository data backed by a MutableLiveData source.
RepositoryData<T>
Base interface for repository data holders.
SL
A minimalist service locator for straightforward dependency injection. No async support, no scopes, no modules, no tags. Just simple registration and retrieval of instances.
ViewModel
Base class for ViewModels in the MVVM pattern.
ViewState<T extends ViewModel, W extends StatefulWidget>
Base state for MVVM views.
ViewWidget<T extends ViewModel>
A ViewWidget is a simplified version of a StatefulWidget + ViewState. It is a generic class that takes a ViewModel as a type parameter. By default, it uses the built-in service locator to resolve the ViewModel. You can register your ViewModel in the service locator before running the app:
Watch<T>
Widget that rebuilds when a LiveData value changes.

Mixins

WatchMixin<T extends StatefulWidget>
Mixin that handles LiveData observation lifecycle.

Extensions

DataScopeExtensions on DataScope
Extension methods for combining multiple LiveData or ChangeNotifier sources.
ListLiveData on LiveData<Iterable<D>>
Extension methods for LiveData containing collections.
LiveDataExtensions on LiveData<T>
Extension methods for LiveData transformation and manipulation.
MutableDataScope on DataScope
Extension methods for creating MutableLiveData within a DataScope.

Typedefs

ChangeDetector<T> = bool Function(T a, T b)
A function that determines if a value has changed.
FactoryFunc<T> = T Function(Injector i)
Function type for factory methods with an injector parameter.
Injector = D Function<D>()