Chat constructor
const
Chat({
- @JsonKey(name: 'id') required int id,
- @JsonKey(name: 'type') required ChatType type,
- @JsonKey(name: 'title') String? title,
- @JsonKey(name: 'username') String? username,
- @JsonKey(name: 'first_name') String? firstName,
- @JsonKey(name: 'last_name') String? lastName,
- @JsonKey(name: 'is_forum') bool? isForum,
- @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;