Item constructor

const Item(
  1. int id,
  2. String name,
  3. int cost,
  4. @JsonKey(name: 'fling_power') int? flingPower,
  5. @JsonKey(name: 'fling_effect') NamedAPIResource? flingEffect,
  6. List<NamedAPIResource> attributes,
  7. NamedAPIResource category,
  8. @JsonKey(name: 'effect_entries') List<VerboseEffect> effectEntries,
  9. @JsonKey(name: 'flavor_text_entries') List<VersionGroupFlavorText> flavorTextEntries,
  10. @JsonKey(name: 'game_indices') List<GenerationGameIndex> gameIndices,
  11. List<Name> names,
  12. ItemSprites sprites,
  13. @JsonKey(name: 'held_by_pokemon') List<ItemHolderPokemon> heldByPokemon,
  14. @JsonKey(name: 'baby_trigger_for') APIResource? babyTriggerFor,
  15. List<MachineVersionDetail> machines,
)

Implementation

const factory Item(
  /// The identifier for this resource.
  int id,

  /// The name for this resource.
  String name,

  /// The price of this item in stores.
  int cost,

  /// The power of the move Fling when used with this item.
  @JsonKey(name: 'fling_power') int? flingPower,

  /// The effect of the move Fling when used with this item.
  ///
  /// See also:
  ///
  /// [ItemFlingEffect]
  @JsonKey(name: 'fling_effect') NamedAPIResource? flingEffect,

  /// A list of attributes this item has.
  ///
  /// See also:
  ///
  /// [ItemAttribute]
  List<NamedAPIResource> attributes,

  /// The category of items this item falls into.
  ///
  /// See also:
  ///
  /// [ItemCategory]
  NamedAPIResource category,

  /// The effect of this ability listed in different languages.
  @JsonKey(name: 'effect_entries') List<VerboseEffect> effectEntries,

  /// The flavor text of this ability listed in different languages.
  @JsonKey(name: 'flavor_text_entries')
      List<VersionGroupFlavorText> flavorTextEntries,

  /// A list of game indices relevent to this item by generation.
  @JsonKey(name: 'game_indices') List<GenerationGameIndex> gameIndices,

  /// The name of this item listed in different languages.
  List<Name> names,

  /// A set of sprites used to depict this item in the game.
  ItemSprites sprites,

  /// A list of Pokémon that might be found in the wild holding this item
  @JsonKey(name: 'held_by_pokemon') List<ItemHolderPokemon> heldByPokemon,

  /// An evolution chain this item requires to produce a bay during mating.
  ///
  /// See also:
  ///
  /// [EvolutionChain]
  @JsonKey(name: 'baby_trigger_for') APIResource? babyTriggerFor,

  /// A list of the machines related to this item.
  List<MachineVersionDetail> machines,
) = _Item;