how to display no. of character user can type and how many characters user had typed in TextFormField Flutter
113
You can add maxLength property (it will show the writtenCharacters/totalLimit)
TextFormField(
maxLength: 45,
)
Or you can also have alternative (it will not show the writtenCharacters/totalLimit), but for this you need to import
import 'package:flutter/services.dart';
TextFormField(
inputFormatters: [
LengthLimitingTextInputFormatter(45),
],
)
Author by
Dhanraj Nimbalkar
Updated on December 12, 2022Comments
-
Dhanraj Nimbalkar over 1 year
How can we display the count of input characters entered by the user and how many characters user can type in that TEXTFORMFIELD in Flutter? Like this
image credits : blog link
-
Dhanraj Nimbalkar about 3 yearsBut I need to use TEXTFORMFIELD not TEXTFIELD
-
Dhanraj Nimbalkar about 3 yearsThanks , Already I am using it(the 2nd one); but I want to display it as well.. Update :: Thanks the 1st one works. my bad
-
Tanha Patel about 3 yearsThen 1st one can help!