NumberEditingTextController.currency constructor
NumberEditingTextController.currency({})
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;
}