notifyMetaDataChanged method Null safety

void notifyMetaDataChanged(
  1. BaseChannel channel,
  2. Map<String, dynamic> data
)

Implementation

void notifyMetaDataChanged(BaseChannel channel, Map<String, dynamic> data) {
  _channelHandlers.values.forEach((element) {
    final created = Map<String, String>.from(data['created'] ?? {});
    final updated = Map<String, String>.from(data['updated'] ?? {});
    final deleted = List<String>.from(data['deleted'] ?? []);

    if (created.isNotEmpty) element.onMetaDataCreated(channel, created);
    if (updated.isNotEmpty) element.onMetaDataUpdated(channel, updated);
    if (deleted.isNotEmpty) element.onMetaDataDeleted(channel, deleted);
  });
}