create static method

Game create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "game",
  3. String special_return_type = "game",
  4. num? id,
  5. String? short_name,
  6. String? title,
  7. FormattedText? text,
  8. String? description,
  9. Photo? photo,
  10. Animation? animation,
})
override

Generate By AZKADEV | Azka Axelion Gibran Script Dont edit by hand or anything manual

Implementation

static Game create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "game",
  String special_return_type = "game",
  num? id,
  String? short_name,
  String? title,
  FormattedText? text,
  String? description,
  Photo? photo,
  Animation? animation,
}) {
  // Game game = Game({
  final Map game_data_create_json = {
    "@type": special_type,
    "@return_type": special_return_type,
    "id": id,
    "short_name": short_name,
    "title": title,
    "text": (text != null) ? text.toJson() : null,
    "description": description,
    "photo": (photo != null) ? photo.toJson() : null,
    "animation": (animation != null) ? animation.toJson() : null,
  };

  game_data_create_json.removeWhere((key, value) => value == null);

  if (schemeUtilsIsSetDefaultData) {
    defaultData.forEach((key, value) {
      if (game_data_create_json.containsKey(key) == false) {
        game_data_create_json[key] = value;
      }
    });
  }
  return Game(game_data_create_json);
}