onCacheChange method

  1. @override
StreamSubscription onCacheChange(
  1. CacheChangeListener callback
)
override

Implementation

@override
StreamSubscription<dynamic> onCacheChange(CacheChangeListener callback) {
  return realmEventChannel.receiveBroadcastStream().listen((event) {
    List<Map<String, dynamic>> data = (event as List<Map<Object?, Object?>>)
        .map((e) => e.cast<String, dynamic>())
        .toList();
    callback(data);
  });
}