LengthLimitingTextInputFormatter class Null safety
A TextInputFormatter that prevents the insertion of more characters than allowed.
Since this formatter only prevents new characters from being added to the text, it preserves the existing TextEditingValue.selection.
Characters are counted as user-perceived characters using the characters package, so even complex characters like extended grapheme clusters and surrogate pairs are counted as single characters.
- maxLength, which discusses the precise meaning of "number of characters".
- hashCode → int
The hash code for this object.
- maxLength → int?
The limit on the number of user-perceived characters that this formatter
- maxLengthEnforcement → MaxLengthEnforcement?
Determines how the maxLength limit should be enforced.
- runtimeType → Type
A representation of the runtime type of the object.
TextEditingValue oldValue, TextEditingValue newValue) → TextEditingValue
Called when text is being typed or cut/copy/pasted in the EditableText.
Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
) → String
A string representation of this object.
[TargetPlatform? platform]) → MaxLengthEnforcement
Returns a MaxLengthEnforcement that follows the specified
TextEditingValue value, int maxLength) → TextEditingValue
- Truncate the given TextEditingValue to maxLength user-perceived characters.