Money.from
test('parse with Currency', () {
// create one (1) australian dollar
Money.fromFixed(Fixed.fromInt(100), isoCode: 'AUD');
Money.parse(r'$1.00', isoCode: 'AUD');
Money.fromFixedWithCurrency(Fixed.fromInt(100), CommonCurrencies().aud);
Money.parseWithCurrency(r'$1.00', CommonCurrencies().aud);
/// Create a money value of $5.10 usd from an int
Money.fromInt(510, isoCode: 'USD');
/// Create a money value of ¥25010 from a big int.
Money.fromBigInt(BigInt.from(25010), isoCode: 'JPY');
});Last updated
Was this helpful?