simple_mvvm
library
Classes
ModelWidget <TViewModel extends ViewModel >
A ModelWidget is a StatelessWidget that provides its children with a ViewModel
ViewModel <T >
A ViewModel is a State object that can be used to store data and update the UI
When the ViewModel calls setState, the UI will be updated
ViewModelBuilder <TViewModel >
A ViewModelBuilder is a StatefulWidget that builds a ViewModel of type T
This is the widget you will add to your widget tree
ViewModelProvider <TViewModel extends ViewModel >
A ViewModelProvider is an InheritedWidget that provides its children with a ViewModel
It is returned by the ViewModel's build method and should not be edited
Functions
getModel <T > (BuildContext context )
→ T
Get the nearest ViewModel of type T
This is a convenience method that can be used to get the ViewModel from a BuildContext