Product constructor
const
Product(
- @JsonKey(name: 'identifier') String identifier,
- @JsonKey(name: 'description') String description,
- @JsonKey(name: 'title') String title,
- @JsonKey(name: 'price') double price,
- @JsonKey(name: 'price_string') String priceString,
- @JsonKey(name: 'currency_code') String currencyCode, {
- @JsonKey(name: 'introPrice', nullable: true) IntroductoryPrice? introductoryPrice,
- @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;