Package selection guidance compiled from public package information, community data, and project usage.
Minimal MVN is a lightweight state management solution for Flutter that implements the Model-View-Notifier (MVN) pattern. It provides a simple, reactive way to manage app state with minimal boilerplate. By separating data (model), UI (view), and state updates (notifier), it promotes clean architecture and easy testability. The package is designed for developers seeking a straightforward alternative to heavier state management solutions without sacrificing performance or scalability.
Use cases
Simple app state management
Reactive UI updates
Lightweight alternatives to providers
Testable business logic
Small to medium-sized Flutter apps
Key features
Minimal boilerplate
Model-View-Notifier pattern
Reactive state updates
Easy integration with existing code
Supports all Flutter platforms
Suitable for
Developers wanting simplicity
Projects avoiding complex state libraries
Teams prioritizing maintainability
Learning state management fundamentals
Apps with moderate state complexity
Considerations
Not ideal for very large-scale apps
Limited built-in debugging tools
No built-in persistence
Requires manual setup for advanced features
Best suited for apps with basic to intermediate state needs
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
Minimal MVN
A minimal state management package for Flutter. Part of a minimalistic architecture based on the MVN (Model-View-Notifier) pattern.
This package aims for the simplest possible architecture, making it easier to understand and use, while offering an alternative to the growing complexity found in many other state management solutions, in an attempt to minimize side effects.
The classical Flutter counter app demonstrates basic state management. The counter on the top is a non disposable notifier, so it keeps memory when re-entering the page. The one on the bottom is a disposable notifier, so it resets when re-entering the page.
Chroma Counter
A more advanced counter widget, which increases the counter, and randomly changes color and shape. The reveal button shows a second widget using the same notifier. Thanks to the autodispose feature, the notifier is disposed only when both the widgets are not visible anymore. The string on top of the choma counter updates every 10 counts, thanks to the select feature, which is used to avoid unnecessary rebuilds.
In tests, you can override the notifier with a mock notifier through the minimal manager:
testWidgets('should update UI when state changes', (tester) async {
// Use the minimal manager to override the notifier
chromaCounterManager.override(MockCounterNotifier.new);
await tester.pumpWidget(constMaterialApp(home: ChromaCounter()));
// Change state through the mock notifier
chromaCounterManager.notifier.nextMetamorph();
await tester.pump();
final newColor = _getContainerColor(tester);
// Test the exact color instead of a random oneexpect(newColor, equals(Colors.red));
});