DistanceUnit class
Represent a distance in millimeters, centimeters or inches
- Implementers
- Annotations
-
- @freezed
Constructors
- DistanceUnit.cm(double value)
-
constfactory
-
DistanceUnit.fromJson(Map<
String, dynamic> json) -
factory
- DistanceUnit.inch(double value, {@Default(defaultGraduations) int graduations})
-
constfactory
Properties
- cm → Centimeter
-
no setter
-
copyWith
→ $DistanceUnitCopyWith<
DistanceUnit> -
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- inch → Inch
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → double
-
no setterinherited
Methods
-
map<
TResult extends Object?> ({required TResult cm(Centimeter value), required TResult inch(Inch value)}) → TResult -
inherited
-
mapOrNull<
TResult extends Object?> ({TResult? cm(Centimeter value)?, TResult? inch(Inch value)?}) → TResult? -
inherited
-
maybeMap<
TResult extends Object?> ({TResult cm(Centimeter value)?, TResult inch(Inch value)?, required TResult orElse()}) → TResult -
inherited
-
maybeWhen<
TResult extends Object?> ({TResult cm(double value)?, TResult inch(double value, int graduations)?, required TResult orElse()}) → TResult -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> ({required TResult cm(double value), required TResult inch(double value, int graduations)}) → TResult -
inherited
-
whenOrNull<
TResult extends Object?> ({TResult? cm(double value)?, TResult? inch(double value, int graduations)?}) → TResult? -
inherited
Operators
-
operator /(
double value) → DistanceUnit -
operator ==(
Object other) → bool -
The equality operator.
inherited