currency static method

String currency(
  1. double amount, {
  2. String symbol = '\$',
  3. int decimals = 2,
})

Implementation

static String currency(double amount, {String symbol = '\$', int decimals = 2}) {
  return '$symbol${amount.toStringAsFixed(decimals)}';
}