fromJson static method

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

Implementation

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

  return CommunityMemberChats(
    ownedChatIds: List<int>.from(
        ((json['owned_chat_ids'] as List<dynamic>?) ?? <dynamic>[])
            .map((item) =>
                (item is int ? item : int.tryParse(item.toString()) ?? 0))
            .toList()),
    joinedChatIds: List<int>.from(
        ((json['joined_chat_ids'] as List<dynamic>?) ?? <dynamic>[])
            .map((item) =>
                (item is int ? item : int.tryParse(item.toString()) ?? 0))
            .toList()),
  );
}