Product constructor

const Product(
  1. @JsonKey(name: 'identifier') String identifier,
  2. @JsonKey(name: 'description') String description,
  3. @JsonKey(name: 'title') String title,
  4. @JsonKey(name: 'price') double price,
  5. @JsonKey(name: 'price_string') String priceString,
  6. @JsonKey(name: 'currency_code') String currencyCode, {
  7. @JsonKey(name: 'introPrice', nullable: true) IntroductoryPrice? introductoryPrice,
  8. @JsonKey(name: 'discounts', nullable: true) List<Discount>? discounts,
})

Implementation

const factory Product(
  /// Product Id.
  @JsonKey(name: 'identifier') String identifier,

  /// Description of the product.
  @JsonKey(name: 'description') String description,

  /// Title of the product.
  @JsonKey(name: 'title') String title,

  /// Price of the product in the local currency.
  @JsonKey(name: 'price') double price,

  /// Formatted price of the item, including its currency sign.
  @JsonKey(name: 'price_string') String priceString,

  /// Currency code for price and original price.
  @JsonKey(name: 'currency_code') String currencyCode, {

  /// Introductory price for product. Can be null.
  @JsonKey(name: 'introPrice', nullable: true)
      IntroductoryPrice? introductoryPrice,

  /// Collection of discount offers for a product. Null for Android.
  @JsonKey(name: 'discounts', nullable: true) List<Discount>? discounts,
}) = _Product;