Money class
Money fields can be signed or unsigned. Fields that do not explicitly define whether they are signed or unsigned are considered unsigned and can only hold positive amounts. For signed fields, the sign of the value indicates the purpose of the money transfer. See Working with Monetary Amounts for more information.
- Annotations
-
- @JsonSerializable()
Constructors
- Money({int? amount, Currency? currency})
-
@macro Money fields can be signed or unsigned. Fields that do not explicitly
define whether they are signed or unsigned are considered unsigned and can
only hold positive amounts. For signed fields, the sign of the value
indicates the purpose of the money transfer. See Working with Monetary
Amounts for more information.
const
-
Money.fromJson(Map<
String, dynamic> json) -
Converts a Map to an Money
factory
Properties
- amount → int?
-
The amount of money, in the smallest denomination of the currency
indicated by currency. For example, when currency is USD, amount is in
cents. Monetary amounts can be positive or negative. See the specific
field description to determine the meaning of the sign in a particular
case.
final
- currency → Currency?
-
case.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringify → bool?
-
If set to
true
, the toString method will be overridden to output this instance's props.no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts a Money to a Map
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited