ProductCardModel class

A model class representing a product card.

This class contains properties for the product card's title, image URL, price, and callbacks for tapping on the product and adding it to the cart. It is commonly used to hold data for card-based UI elements.

Constructors

ProductCardModel({required String title, required String image, required num price, required VoidCallback onTapProduct, required VoidCallback addToCart})
Creates a ProductCardModel.
const

Properties

addToCart VoidCallback
The callback function to be called when the add to cart button is tapped.
final
hashCode int
The hash code for this object.
no setterinherited
image String
The URL or asset path of the image displayed on the product card.
final
onTapProduct VoidCallback
The callback function to be called when the product card is tapped.
final
price num
The price of the product displayed on the card.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title String
The title text of the product card.
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