NumbersTextInputFormatter class

NumbersTextInputFormatter is a TextInputFormatter that allows only numbers to be typed, with four options:

Inheritance

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) TextEditingValue
Called when text is being typed or cut/copy/pasted in the EditableText.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

decimal NumbersTextInputFormatter
Allows only typing numbers 0-9, plus dot or comma, but if the user types a dot or a comma it will always be converted to the current decimal separator (depending on the locale).
final
decimalWithComma NumbersTextInputFormatter
Allows only typing numbers 0-9, plus dot or comma, but if the user types a dot it will always appear as a comma.
final
decimalWithDot NumbersTextInputFormatter
Allows only typing numbers 0-9, plus dot or comma, but if the user types a comma it will always appear as a dot.
final
integer NumbersTextInputFormatter
Allows only typing numbers 0-9.
final

Static Methods

localeDecimalSeparator() String
Returns the default decimal separator for the current platform locale.