PassioServingUnit class
Data class that represents the serving unit of a food item.
Constructors
- PassioServingUnit(String unitName, UnitMass weight)
-
Creates a new
PassioServingUnit
instance.const -
PassioServingUnit.fromJson(Map<
String, dynamic> json) -
Creates a
PassioServingUnit
instance from a JSON map.factory
Properties
- hashCode → int
-
Calculates the hash code for this
PassioServingUnit
object.no setteroverride - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- unitName → String
-
The name of the unit (e.g., "grams").
final
- weight → UnitMass
-
The corresponding unit of mass (UnitMass) for the unit name.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Converts the
PassioServingUnit
instance to a JSON map. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
Compares two
PassioServingUnit
objects for equality.override