mot library
MOT - Multitude of Triads
A sober and efficient alternative to state management in Dart and Flutter.
The domain lives outside the tree. The UI observes it.
Core Principle
"Simplicity of interface over simplicity of implementation"
MOT must be invisible. Subscribe and forget.
Usage
import 'package:mot/mot.dart';
class UserModel with Beacon {
final name = BeaconField<String>('');
final age = BeaconField<int>(0);
}
// Subscribe (cleanup is automatic when observer dies)
user.name.observe(this, (self) => self.refresh());
Classes
-
BeaconField<
T> - An observable field that notifies observers when its value changes.
-
ObserverEntry<
T extends Object> - An entry representing an observer subscription.
Mixins
- Beacon
- A mixin that transforms any Dart class into an observable model.