Chat constructor

const Chat({
  1. @JsonKey(name: 'id') required int id,
  2. @JsonKey(name: 'type') required ChatType type,
  3. @JsonKey(name: 'title') String? title,
  4. @JsonKey(name: 'username') String? username,
  5. @JsonKey(name: 'first_name') String? firstName,
  6. @JsonKey(name: 'last_name') String? lastName,
  7. @JsonKey(name: 'is_forum') bool? isForum,
  8. @JsonKey(name: 'is_direct_messages') bool? isDirectMessages,
})

Constructs a Chat object.

Implementation

const factory Chat({
  /// Unique identifier for this chat.
  @JsonKey(name: 'id') required int id,

  /// Type of the chat, can be either "private", "group", "supergroup" or
  /// "channel".
  @JsonKey(name: 'type') required ChatType type,

  /// Title, for supergroups, channels, and group chats.
  @JsonKey(name: 'title') String? title,

  /// Username, for private chats, supergroups, and channels if available.
  @JsonKey(name: 'username') String? username,

  /// First name of the other party in a private chat.
  @JsonKey(name: 'first_name') String? firstName,

  /// Last name of the other party in a private chat.
  @JsonKey(name: 'last_name') String? lastName,

  /// True, if the supergroup chat is a forum (has topics enabled).
  @JsonKey(name: 'is_forum') bool? isForum,

  /// Optional. True, if the chat is the direct messages chat of a channel
  @JsonKey(name: 'is_direct_messages') bool? isDirectMessages,
}) = _Chat;