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