Product class
A single product inside a EcommerceTemplate.
Constructors
- Product({required String title, required String price, String? subtitle, String? imageUrl, String? oldPrice, String? discount, double? rating, VoidCallback? onTap, VoidCallback? onAddToCart, VoidCallback? onFavorite})
-
const
Properties
- discount → String?
-
Discount badge.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- imageUrl → String?
-
Image URL.
final
- oldPrice → String?
-
Original (strike-through) price.
final
- onAddToCart → VoidCallback?
-
Add-to-cart callback.
final
- onFavorite → VoidCallback?
-
Favorite toggle callback.
final
- onTap → VoidCallback?
-
Tap callback.
final
- price → String
-
Current price.
final
- rating → double?
-
Rating (0–5).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- subtitle → String?
-
Optional subtitle.
final
- title → String
-
Product name.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited