maskedCurrencyFormat function
Outputs num formated to show in a text
Example: removeZeroDecimal(12); => R$ 0,12 Example: removeZeroDecimal(1254); => R$ 12,54 Example: removeZeroDecimal(12546); => R$ 12,54
Implementation
String maskedCurrencyFormat(n, {String locale: "pt_BR", String symbol: "R\$"}) {
final formatCurrency = NumberFormat.currency(locale: locale, symbol: symbol);
return formatCurrency.format(n / 100);
}