decoding<T> static method
Returns a Money instance decoded from value
by decoder
.
Create your own decoder
s to convert from any type to a Money instance.
Throws FormatException when the passed value contains an invalid format.
Implementation
// ignore: prefer_constructors_over_static_methods
static Money decoding<T>(T value, MoneyDecoder<T> decoder) {
final data = decoder.decode(value);
return Money._from(
Fixed.copyWith(data.amount, scale: data.currency.decimalDigits),
data.currency);
}