NumberEditingTextController.currency constructor

NumberEditingTextController.currency({
  1. String? locale,
  2. String? currencyName,
  3. String? currencySymbol,
  4. num? value,
  5. String? decimalSeparator,
  6. String? groupSeparator,
  7. bool allowNegative = true,
})

Creates a controller instance suitable for formatting input as a money amount

locale - locale to be used for number formatting, defaults to Intl.getCurrentLocale() currencyName - 3-symbol currency code (ex. USD, EUR, TRY) currencySymbol - currency symbol (ex. $, €, ₺) value - optional initial value decimalSeparator - symbol used to separate decimal part groupSeparator - symbol used to group number allowNegative - allow negative number input

Implementation

NumberEditingTextController.currency({
  String? locale,
  String? currencyName,
  String? currencySymbol,
  num? value,
  String? decimalSeparator,
  String? groupSeparator,
  bool allowNegative = true,
}) : _format = ParsedNumberFormat.currency(
        locale: locale,
        currencyName: currencyName,
        currencySymbol: currencySymbol,
        decimalSeparator: decimalSeparator,
        groupSeparator: groupSeparator,
        allowNegative: allowNegative,
      ) {
  number = value;
}