ReactiveMapExtensions<K, V> extension
Extension methods on Map to create reactive maps.
These extensions allow regular Dart maps to be converted into reactive maps that automatically track changes and emit notifications when the map is modified.
Example usage:
// Create a reactive map
final userPrefs = {'theme': 'dark', 'fontSize': 14}.reactive;
// Listen for changes
userPrefs.stream.listen((snapshot) {
print('Preferences changed!');
print('Old: ${snapshot.oldValue}');
print('New: ${snapshot.newValue}');
});
// Modify the map (triggers notification)
userPrefs.value['fontSize'] = 16;
userPrefs.value = Map.from(userPrefs.value); // Trigger notification
- on
-
- Map<
K, V>
- Map<
Properties
-
reactive
→ Reactive<
Map< K, V> > -
Available on Map<
Creates a reactive map from this map.K, V> , provided by the ReactiveMapExtensions extensionno setter
Methods
-
toReactive(
{List< FluxivityMiddleware< ? middlewares}) → Reactive<Map< >K, V> >Map< K, V> > -
Available on Map<
Creates a reactive map with custom middleware from this map.K, V> , provided by the ReactiveMapExtensions extension