NumberRangeInputFormatter class

A TextInputFormatter that constrains user input within an optional numeric range min and max.

Immediately blocks characters that would cause the input to exceed max, blocks negative signs (-) when min >= 0, and blocks negative values that exceed negative min bounds.

Inheritance

Constructors

NumberRangeInputFormatter({num? min, num? max, bool isInt = false})

Properties

hashCode → int
The hash code for this object.
no setterinherited
isInt → bool
Whether the input represents an integer.
final
max → num?
The maximum allowed value. Any character making the number exceed max is blocked immediately.
final
min → num?
The minimum allowed value. If >= 0, typing '-' is blocked immediately.
final
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 Methods

parseNormalized(String s) → num?
Parses a string to num, handling leading decimal dot (e.g. .5 -> 0.5).