Skip to content

ListSignalMixin

ListSignalMixin is a mixin for a Signal that adds reactive methods for List.

class MySignal extends Signal<List<int>> with ListSignalMixin<int> {
MySignal(List<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
}