NotificationFields.fromMap constructor

NotificationFields.fromMap(
  1. Map<String, dynamic>? json
)

Implementation

NotificationFields.fromMap(Map<String, dynamic>? json) {
  if (json != null) {
    eventName = json['eventName'];
    if (json['args'] != null) {
      List<dynamic> jsonList = json['args'].runtimeType == String //
          ? jsonDecode(json['args'])
          : json['args'];
      args = jsonList
          .where((json) => json != null)
          .map((json) => NotificationArgs.fromMap(json))
          .toList();
    } else {
      args = null;
    }
  }
}