ProductSchema class
Schema.org Product structured data.
Enables rich product snippets in Google Search with price, availability, ratings, and reviews.
ProductSchema(
name: 'Flutter Widget Pro',
description: 'Premium widget collection',
image: 'https://example.com/product.png',
brand: 'My Brand',
sku: 'FWP-001',
offer: ProductOffer(price: '29.99', currency: 'USD'),
aggregateRating: AggregateRating(ratingValue: 4.8, reviewCount: 156),
)
- Inheritance
-
- Object
- JsonLdSchema
- ProductSchema
Constructors
-
ProductSchema({required String name, String? description, String? image, List<
String> ? images, String? brand, String? sku, String? gtin, String? mpn, String? url, String? color, String? material, ProductOffer? offer, List<ProductOffer> ? offers, AggregateRating? aggregateRating, List<ProductReview> ? reviews, String? category}) -
const
Properties
- aggregateRating → AggregateRating?
-
final
- brand → String?
-
final
- category → String?
-
final
- color → String?
-
final
- description → String?
-
final
- gtin → String?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- image → String?
-
final
-
images
→ List<
String> ? -
final
- material → String?
-
final
- mpn → String?
-
final
- name → String
-
final
- offer → ProductOffer?
-
final
-
offers
→ List<
ProductOffer> ? -
final
-
reviews
→ List<
ProductReview> ? -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sku → String?
-
final
- url → String?
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJsonLd(
) → String -
Convert to a complete JSON-LD string with
@context.inherited -
toJsonLdMinified(
) → String -
Convert to a minified JSON-LD string (no extra whitespace).
inherited
-
toMap(
) → Map< String, dynamic> -
Convert this schema to a map (without
@context). Subclasses must implement this.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited