Product class final

Full representation of a Shopify Storefront product.

Constructors

Product({required String id, required String title, required String handle, required String description, required String descriptionHtml, required String productType, required String vendor, required List<String> tags, required bool availableForSale, required List<ProductVariant> variants, required List<ProductImage> images, required List<ProductOption> options, ProductImage? featuredImage, ProductSeo? seo, List<Metafield> metafields = const [], DateTime? publishedAt, DateTime? createdAt, DateTime? updatedAt, int? totalInventory, ProductPriceRange? priceRange, ProductPriceRange? compareAtPriceRange, List<SellingPlanGroup> sellingPlanGroups = const [], bool requiresSellingPlan = false})
const
Product.fromJson(Map<String, dynamic> json)
factory

Properties

availableForSale bool
final
compareAtPriceRange ProductPriceRange?
final
createdAt DateTime?
final
defaultVariant ProductVariant?
no setter
description String
final
descriptionHtml String
final
featuredImage ProductImage?
final
handle String
final
hasDiscount bool
no setter
hashCode int
The hash code for this object.
no setteroverride
hasVariants bool
no setter
id String
final
images List<ProductImage>
final
metafields List<Metafield>
final
options List<ProductOption>
final
priceRange ProductPriceRange?
final
productType String
final
publishedAt DateTime?
final
requiresSellingPlan bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sellingPlanGroups List<SellingPlanGroup>
final
seo ProductSeo?
final
tags List<String>
final
title String
final
totalInventory int?
final
updatedAt DateTime?
final
variants List<ProductVariant>
final
vendor String
final

Methods

metafield(String namespace, String key) Metafield?
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override