Skip to content

TrackedSignalMixin

TrackedSignalMixin is a mixin for a Signal that stores the initial and previous value.

class MySignal extends Signal<int> with TrackedSignalMixin<int> {
MySignal(int value) : super(value);
}
void main() {
final signal = MySignal(0);
signal.value = 1;
print(signal.initialValue); // 0
print(signal.previousValue); // null
signal.value = 2;
print(signal.initialValue); // 0
print(signal.previousValue); // 1
}