Issue
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
Solution
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),
],
)
Answered By – tanharpatel
Answer Checked By – Marie Seifert (FlutterFixes Admin)