fromJson method

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

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;
}