FCMNotification.fromJson constructor

FCMNotification.fromJson(
  1. Map<String, dynamic>? json
)

Implementation

factory FCMNotification.fromJson(Map<String, dynamic>? json) {
  json!['notification'] = json['notification']?.cast<String, dynamic>();
  json['data'] = json['data'] != null
      ? json['data'].cast<String, dynamic>()
      // Handle iOS Notifications where it doesn't contain data object (All are in one Map)
      : json.cast<String, dynamic>();
  return _$FCMNotificationFromJson(json);
}