Price class

Price of something.

Available extensions
Annotations

Constructors

Price({required Sum sum, required Currency currency})
const
Price.eur(double amount)
Constructs a Price with EUR currency of the provided amount.
Price.fromJson(Map<String, dynamic> json)
Constructs a Price from the provided json.
factory
Price.usd(double amount)
Constructs a Price with USD currency of the provided amount.
Price.usdt(double amount)
Constructs a Price with USDT currency of the provided amount.
Price.xxx(double amount)
Constructs a Price with XXX currency of the provided amount.

Properties

currency Currency
Currency of this Price.
final
hashCode int
The hash code for this object.
no setterinherited
isZero bool
Indicates whether this Price is zero.
no setter
l10n String

Available on Price, provided by the PriceL10nExtention extension

Returns a localized string of this Price.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sum Sum
Sum of this Price.
final

Methods

l10next({int digits = 2}) String

Available on Price, provided by the PriceL10nExtention extension

Returns a localized string of this Price with digits configurable.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Returns a Map representing this Price.
toString() String
A string representation of this object.
override

Operators

operator *(Price other) Price
Multiplies this Price to the other.
operator ==(Object other) bool
The equality operator.
inherited

Constants

zero → const Price
Price with value of zero with a G currency.