ProductModel class

A model class representing a product.

Constructors

ProductModel({required num id, required String title, required String image, required String category, required String description, required num price, required RatingModel rating})
Creates a new ProductModel instance.
const
ProductModel.empty()
Creates an empty ProductModel instance with default values.
factory
ProductModel.fromJson(Map<String, dynamic> json)
Creates a ProductModel instance from a JSON object.
factory

Properties

category String
The category of the product.
final
description String
The description of the product.
final
hashCode int
The hash code for this object.
no setterinherited
id num
The unique identifier of the product.
final
image String
The URL of the product image.
final
price num
The price of the product.
final
rating RatingModel
The rating of the product.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title String
The title of the product.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
Returns a string representation of the ProductModel instance.
override

Operators

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