Skip to content
pubscout

mvvm_plus

1.5.4, released 3 years ago by richardcoutts.com

Lightweight Flutter MVVM implementation with state sharing via global registry or inherited widgets.

WASM-ready
$ flutter pub add mvvm_plus
Source repository

What it does

Organizes UI into View widgets and business logic into ViewModels extending ChangeNotifier. It includes a built-in locator for sharing states either globally or through inherited widgets, along with convenience property types like ValueNotifier, FutureProperty, and StreamProperty.

AI-written summary of version 1.5.4, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want to structure your Flutter application using the MVVM pattern.
  • You need lightweight state management combined with a simple dependency locator similar to GetIt or Provider.

Skip it when

  • You prefer strict event-driven state architectures like BLoC/Cubit.
  • Your project standardizes entirely around Riverpod for state management.

Strengths

  • Simple and small API extending native Flutter classes.
  • Supports both global registry and widget tree (inherited) locations for ViewModels.
  • Includes specialized properties like FutureProperty and StreamProperty for easy async data handling.

Weaknesses

  • Requires learning its specific MVVM widget and view model extension patterns.
  • Less ecosystem tooling compared to major state management libraries like Provider or Riverpod.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1
class MyWidgetViewModel extends ViewModel {
  String someText = 'Hello';
}

class MyWidget extends ViewWidget<MyWidgetViewModel> {
  MyWidget({super.key}) : super(builder: () => MyWidgetViewModel());

  @override
  Widget build(BuildContext context) {
    return Text(viewModel.someText);
  }
}

Alternatives

Packages that do the same job and could replace mvvm_plus.

  • provider

    If you prefer standard InheritedWidget-based dependency injection and state management without the strict MVVM class hierarchy.

  • riverpod

    If you want compile-safe global state management without relying on BuildContext or registries.

  • flutter_bloc

    If you need a strict predictable state machine architecture separating events and states.