Subscription.fromMap constructor

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

Implementation

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

    remove = json['remove'] != null ? json['remove'] : null;
    success = json['success'];
  }
}