Skip to content

MapSignal

Map signals can be created by extension or method and implement the Map interface.

mapSignal, MapSignal

final s = mapSignal({'a': 1, 'b': 2, 'c': 3});

toSignal()

final s = {'a': 1, 'b': 2, 'c': 3}.toSignal();

Methods

Map modifications are done directly on the underlying map and will trigger signals as expected.

final s1 = mapSignal({'a': 1, 'b': 2, 'c': 3});
// by key
s1['a'] = -1;
s1['d'] = 7;
s1['d']; // 7
// expose common Dart Map interfaces
s1.addAll({'e': 6, 'f': 7});
s1.remove('b');
s1.keys.length; // 5