ChatFolder.fromJson constructor

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

Parses a ChatFolder from TDLib JSON.

Implementation

factory ChatFolder.fromJson(Map<String, dynamic> json) => ChatFolder(
      title: _readString(json['title']),
      icon: _readOptional(json['icon'], ChatFolderIcon.fromJson),
      colorId: _readInt(json['color_id']),
      isShareable: _readBool(json['is_shareable']),
      pinnedChatIds: _readList<int>(json['pinned_chat_ids'], _readInt),
      includedChatIds: _readList<int>(json['included_chat_ids'], _readInt),
      excludedChatIds: _readList<int>(json['excluded_chat_ids'], _readInt),
      excludeMuted: _readBool(json['exclude_muted']),
      excludeRead: _readBool(json['exclude_read']),
      excludeArchived: _readBool(json['exclude_archived']),
      includeContacts: _readBool(json['include_contacts']),
      includeNonContacts: _readBool(json['include_non_contacts']),
      includeBots: _readBool(json['include_bots']),
      includeGroups: _readBool(json['include_groups']),
      includeChannels: _readBool(json['include_channels']),
      extra: json['@extra'],
      clientId: _readClientId(json['@client_id']),
    );