Currency class sealed
A class representing a currency. This is an abstract class and should not be instantiated directly.
The code
, decimalMark
, name
, and thousandsSeparator
parameters are
required. The symbol
parameter is optional.
This class provides common properties for currencies, such as the code
,
name
, symbol
, decimalMark
, and thousandsSeparator
. It also provides
a toString
method that can be used to print the contents of a Currency
instance.
This class is extended by the FiatCurrency and CryptoCurrency classes, which provide additional properties specific to fiat and crypto currencies, respectively.
The code
parameter should not be empty. The name
parameter should not be
empty. The symbol
parameter should not be empty if it is provided.
- Implemented types
- Implementers
Constructors
Properties
- code → String
-
The standardized code for the currency.
final
- decimalMark → String
-
The decimal mark, or character used to separate the whole unit from the
subunit.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
The name of the currency.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- symbol → String?
-
The currency symbol.
final
- thousandsSeparator → String
-
The character used to separate thousands grouping of the whole unit.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
{bool short = true}) → String -
Returns a string representation of the currency.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited