money2
Search…
Currency Predicates
To check that money value has an expected currency use the methods isInCurrency(Currency) and isInSameCurrencyAs(Money):
import 'package:money2/money2.dart';
fiveDollars.isInCurrency(usd); // => true
fiveDollars.isInCurrency(eur); // => false
import 'package:money2/money2.dart';
fiveDollars.isInSameCurrencyAs(sevenDollars); // => true
fiveDollars.isInSameCurrencyAs(fiveEuros); // => false
Copy link