INNER CODE UNIT · Dart
RegistryMap
foxsofter/flutter_thrio · lib/src/collection/registry_map.dart:24
class RegistryMap<K, V> {
final Map<K, V> _maps = {};
VoidCallback registry(K key, V value) {
assert(key != null, 'key must not be null.');
assert(value != null, 'value must not be null.');
_maps[key] = value;
return () {
_maps.remove(key);
};
}
VoidCallback registryAll(Map<K, V> values) {
assert(values.isNotEmpty, 'values must not be null or empty.');
_maps.addAll(values);
return () {