How can I change the alignment of a TextFormField validation error message?
TextFormField(
textAlign: TextAlign.center,
decoration: const InputDecoration(
errorStyle: TextStyle(
fontSize: 16.0,
),
),
validator: (value) {
if (value.isEmpty) {
return 'Please enter some text';
}
return null;
},
),
Current output:
Expected output:
You can't change the default validator, but try creating a custom one!