Enhance the clarity of your TextFormFiled
's error messages by allowing multiline text. By setting errorMaxLines: 2
within the InputDecoration
, you enable the error label to span multiple lines, providing ample space for detailed explanations.
Implement this feature with ease:
``` TextFormField( decoration: const InputDecoration( icon: Icon(Icons.person), hintText: 'What do people call you?', labelText: 'Name *', errorMaxLines: 2 ), validator: (String value) { return value.contains('@') ? 'Do not use the @ char. Do not use the @ char. Do not use the @ char. Do not use the @ char.' : null; }, ), ```This example demonstrates how multiple lines enhance error message clarity. Please note that obscureText: true
has been intentionally omitted to showcase the multiline error message functionality.