vm 1.0.2 copy "vm: ^1.0.2" to clipboard
vm: ^1.0.2 copied to clipboard

outdated

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.

Build Status Pub package Star on GitHub License: MIT

MVVM

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

Maintainers #

License #

License: MIT

3
likes
0
points
30
downloads

Publisher

unverified uploader

Weekly Downloads

A very simple flutter plugin that implements the `MVVM` pattern.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, provider

More

Packages that depend on vm