handleNotification method
How to handle notifications received by the internal notificationSubscription.
Possible operations are: 'update', 'append', 'remove', 'delete', 'init', null
These operations are the same as AtNotification, with an additional 'init'
operation
which is used by getKeys() to indicate that this key was preloaded.
Implementation
@override
void handleNotification(AtKey key, AtValue value, String? operation) {
switch (operation) {
case 'delete':
case 'remove':
store.remove(_generateRef(key, value));
break;
case 'init':
case 'update':
case 'append':
default:
store[_generateRef(key, value)] = convert(key, value)! as T;
}
controller.add(_castTo(store.values));
}