Amount class
Constructors
- Amount({required BigInt value, required int decimals})
-
const
- Amount.convert({required num value, required int decimals})
-
Converts the given value to the smallest unit of the currency
factory
- Amount.from({required int value, required int decimals})
- Converts the given value to a BigInt This is useful when the value is already in the smallest unit of the currency
- Amount.fromJson(Map json)
-
factory
Properties
- decimals → int
-
final
- displayDouble → double
-
no setter
- displayValue → String
-
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → BigInt
-
final
Methods
-
convertTo(
int newDecimals) → Amount -
convertToDecimals(
int newDecimals) → Amount -
copyWith(
{BigInt? value, int? decimals}) → Amount -
isOther(
Amount other) → bool -
multiplyAndCeil(
double multiplier) → Amount -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator *(
Amount other) → Amount - Operators
-
operator +(
Amount other) → Amount -
operator -(
Amount other) → Amount -
operator /(
Amount other) → Amount -
operator <(
Amount other) → bool -
operator ==(
Object other) → bool -
The equality operator.
override
-
operator >(
Amount other) → bool
Static Properties
- negativeOne → Amount
-
no setter
- zero → Amount
-
no setter