maac_mvvm library

Classes

BaseViewModelState<T extends ViewStatefulWidget>
BaseViewModelState is an abstract class for managing the state of a widget that needs visibility detection and dependency injection using GetIt. This class leverages a unique visibility detector key for each instance, enabling scoped dependency management based on visibility changes.
FutureUseCase<Result, Param>
LifecycleComponent
The abstract base class for a ViewModel with lifecycle callbacks in Flutter.
LifeCycleManager
MediatorStreamData<T>
MergeStreamDataConsumer
A stateless-in-spirit widget that rebuilds whenever any of streams emits, without pairing up or waiting on the others — the merge semantics of package:async's StreamGroup.mergeBroadcast, applied to StreamData. Since each StreamData already tracks its own latest StreamData.data synchronously, builder doesn't need a combined payload — it just needs to know "something changed, rebuild".
StreamData<T>
A StreamData class used when updating data state from ViewModel to Widget.
StreamDataConsumer<Data>
A stateless widget that listens to a stream of data (StreamData) and rebuilds the UI each time new data is emitted. It uses a DataConsumerBuilder function to build the UI with the updated data.
StreamDataConsumer2<A, B>
Rebuilds whenever either streamData1 or streamData2 emits, passing both of their latest StreamData.data values to builder. A thin, type-safe wrapper around MergeStreamDataConsumer for the common 2-source case.
StreamDataConsumer3<A, B, C>
Rebuilds whenever streamData1, streamData2, or streamData3 emits, passing all three of their latest StreamData.data values to builder. A thin, type-safe wrapper around MergeStreamDataConsumer for the common 3-source case.
StreamDataViewModel<T>
The StreamDataViewModel class is used when initializing StreamData while binding it with ViewModel.
StreamUseCase<Result, Param>
UseCase<Result, Param>
ViewModel
A class that manages the logic state of a widget and binds it to the widget's lifecycle.
ViewModelsWidget
ViewModelWidget<T extends ViewModel>
ViewState<T extends ViewStatefulWidget>
ViewStatefulWidget
WrapperContext

Functions

executeCondition(bool condition, dynamic invoker()) → dynamic

Typedefs

DataConsumerBuilder<Data> = Widget Function(BuildContext context, Data data)
A typedef for a builder function that is used to create a widget that consumes data from a stream. The builder function is called each time new data is emitted by the stream.
DataConsumerBuilder2<A, B> = Widget Function(BuildContext context, A a, B b)
A typedef for a builder function that combines the latest data of 2 StreamData sources. Called on every rebuild triggered by StreamDataConsumer2 — see MergeStreamDataConsumer for the merge semantics.
DataConsumerBuilder3<A, B, C> = Widget Function(BuildContext context, A a, B b, C c)
A typedef for a builder function that combines the latest data of 3 StreamData sources. Called on every rebuild triggered by StreamDataConsumer3 — see MergeStreamDataConsumer for the merge semantics.
MergedDataBuilder = Widget Function(BuildContext context)
A builder function called on every rebuild triggered by MergeStreamDataConsumer. Unlike DataConsumerBuilder, it doesn't carry a payload — read whichever StreamData.data you need directly, since they're already up to date by the time this is called.