fromJson method Null safety

  1. @override
T fromJson(
  1. Object json
)
override

Implementation

@override
T fromJson(Object json) {
  if (json is Map<String, dynamic>) {
    if (json.containsKey('participant_count')) {
      return OpenChannel.fromJsonAndCached(json) as T;
    } else {
      return GroupChannel.fromJsonAndCached(json) as T;
    }
  }
  return json as T;
}