ComputedNotifier<T> constructor
ComputedNotifier<T> (
- T compute(), {
- required List<
ChangeNotifier> depends,
Creates a ComputedNotifier.
The compute
function should return the value.
The depends
list should contain all of the notifiers that the value
depends on.
Implementation
ComputedNotifier(this.compute, {required this.depends}) {
_onChange = oneCallTask(() {
_value = compute();
notifyListeners();
});
}