ProductQuantityMixin mixin

A mixin containing utility methods for handling product quantity and price calculations.

Mixin Applications

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

calculatePrice({required num price, required num quantity}) num
Calculates the total price for a product based on its price and quantity.
changeQuantity({required ProductEntity product, required num quantity}) num
Changes the quantity of a product, clamped between the minimum and maximum order quantity.
decreaseQuantity({required ProductEntity product, required num quantity}) num
Decreases the quantity of a product by the specified step, clamped between the minimum and maximum order quantity.
increaseQuantity({required ProductEntity product, required num quantity}) num
Increases the quantity of a product by the specified step, clamped between the minimum and maximum order quantity.
isQuantityIncreased({required num previous, required num current}) bool
Comparison of current and entered number
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