Product class

This class models a reference to a product.

Implemented types
Annotations

Constructors

Product({required String brand, required String category, required Money cost, String description = '', required String id, required String name, Country? origin, required Money price})
Models a product.
const
Product.fromMap(Map<String, dynamic> map)
Creates an Product instance starting from a Map<String, dynamic> map.

Properties

brand String
The company that made this product.
final
category String
The category.
final
cost Money
The cost of purchasing this product.
final
description String
The description. For example, it may contain technical details, or advice on use.
final
hashCode int
The hash code for this object.
no setteroverride
id String
The identifier. It should be unique.
final
name String
The name that .
final
origin → Country?
The country of origin of this product.
final
price Money
The selling price.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

compareTo(covariant Product other) int
The order of the comparisons is:
override
copyWith({String? brand, String? category, Money? cost, String? description, String? id, String? name, Country? origin, Money? price}) Product
Creates a copy of this Product instance where the only changes are those specified in the parameters of this method.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
Creates a Map<String, dynamic> map representation of this instance.
toString() String
A string representation of this object.
inherited

Operators

operator <(covariant Product other) bool
Returns if this instance is less than the other.
operator <=(covariant Product other) bool
Return if this instance is less than or equal to the other.
operator ==(covariant Product other) bool
The equality operator.
override
operator >(covariant Product other) bool
Return if this instance is greater than the other.
operator >=(covariant Product other) bool
Return if this instance is greater than or equal to the other.