fromJson static method

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

Implementation

static Community? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return Community(
    id: (json['id'] as int?) ?? 0,
    haveAccess: (json['have_access'] as bool?) ?? false,
    name: (json['name'] as String?) ?? '',
    photo: ChatPhotoInfo.fromJson(tdMapFromJson(json['photo'])),
    date: (json['date'] as int?) ?? 0,
    status: CommunityMemberStatus.fromJson(tdMapFromJson(json['status'])),
    permissions: CommunityPermissions.fromJson(
      tdMapFromJson(json['permissions']),
    ),
  );
}