Game constructor

const Game({
  1. @JsonKey(name: 'title') required String title,
  2. @JsonKey(name: 'description') required String description,
  3. @JsonKey(name: 'photo') required List<PhotoSize> photo,
  4. @JsonKey(name: 'text') String? text,
  5. @JsonKey(name: 'text_entities') List<MessageEntity>? textEntities,
  6. @JsonKey(name: 'animation') Animation? animation,
})

Constructs a Game object.

Implementation

const factory Game({
  /// Title of the game
  @JsonKey(name: 'title') required String title,

  /// Description of the game
  @JsonKey(name: 'description') required String description,

  /// Photo that will be displayed in the game message in chats.
  @JsonKey(name: 'photo') required List<PhotoSize> photo,

  /// Optional. Brief description of the game or high scores included in the game message.
  @JsonKey(name: 'text') String? text,

  /// Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc.
  @JsonKey(name: 'text_entities') List<MessageEntity>? textEntities,

  /// Optional. Animation that will be displayed in the game message in chats.
  @JsonKey(name: 'animation') Animation? animation,
}) = _Game;