vm 1.0.2
vm: ^1.0.2 copied to clipboard
A very simple flutter plugin that implements the `MVVM` pattern.
Flutter VM (ViewModel) #
A very simple flutter plugin that implements the MVVM pattern.
Model–View–ViewModel (MVVM) is a software architectural pattern that facilitates the separation of the development of the graphical user interface (the view) – be it via a markup language or GUI code – from the development of the business logic or back-end logic (the model) so that the view is not dependent on any specific model platform.

Getting Started #
- Add this to your pubspec.yaml
dependencies: vm: ^1.0.0 - Get the package from Pub:
flutter packages get - Import it in your file
import 'package:vm/vm.dart';
Features #
...
Usage #
First create a [ViewModel]
class CounterViewModel extends ViewModel {
int value;
void increment() {
value++;
notifyListeners();
}
}
Next use this model with [ViewModelBuilder]
ViewModelBuilder<CounterViewModel>(
model: CounterViewModel(),
builder: (context, model, child) {
return Text('${model.value}');
},
)
Check out the complete Example
Changelog #
Please have a look in CHANGELOG