tryParse static method
Implementation
static CurrencyAmount? tryParse(String s, {required Currency currency}) {
final decimal = Decimal.tryParse(s);
if (decimal == null) {
return null;
}
return CurrencyAmount.fromDecimal(decimal, currency: currency);
}