title: How to force user to input a minimum of 2 characters in TextField in Flutter?
body: <p>I want to Build a TextField in Flutter in which the user must type in his name, but I want to force him to input a minimum of 2 characters.</p>
  
  <p>This is my code:</p>
  
  <pre><code>TextField(
                      autofocus: true,
                      textCapitalization: TextCapitalization.words,
                      textAlign: TextAlign.center,
                      decoration: InputDecoration(
                        labelStyle: TextStyle(color: Colors.blue[900]),
                        border: InputBorder.none,
                        hintText: 'VORNAME',
                      ),
                      style: TextStyle(
                          color: Colors.blue[900],
                          fontWeight: FontWeight.w600,
                          fontSize: MediaQuery.of(context).size.width * 0.075),
                      cursorColor: Colors.greenAccent,
                      inputFormatters: &lt;TextInputFormatter&gt;[
                        WhitelistingTextInputFormatter(RegExp("[a-zA-ZÄäÖöÜü]")) //Only Text as input
                      ],
                      onChanged: (value) {
                        userData.forename = value;
                      },
                      onSubmitted: (value) {
                        Navigator.of(context).push(
                            CupertinoPageRoute(builder: (context) =&gt; SurName()));
                      }),
  </code></pre>
  
  <p>How can I achieve this?
  Thank you in advance!</p>
  
  <p>Ben</p>