Skip to content

SetSignalMixin

SetSignalMixin is a mixin for a Signal that adds reactive methods for Set.

class MySignal extends Signal<Set<int>> with SetSignalMixin<int> {
MySignal(Set<int> value) : super(value);
}
void main() {
final signal = MySignal({1, 2, 3});
effect(() {
print(signal.length);
});
signal.add(4);
signal.remove(1);
print(signal.contains(2)); // true
}