I have a TextFormField to collect user authentication input, and it's pretty fine.
But when it shows the validation message, this happens:
How can I change the position of the error message to this do not happen anymore? I just want a way do easy fix this and the field still pretty. Here is the code.
Form(
key: _formKey,
child: Container(
width: double.infinity,
height: 40,
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
blurRadius: 1.1,
color: Colors.black45,
spreadRadius: 0.5,
offset: Offset(
1.5,
2,
),
),
],
borderRadius: BorderRadius.circular(20),
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: SizedBox(
height: 40,
child: TextFormField(
style: TextStyle(color: Colors.black),
decoration: InputDecoration(
border: InputBorder.none,
disabledBorder: InputBorder.none,
enabledBorder: InputBorder.none,
errorBorder: InputBorder.none,
focusedBorder: InputBorder.none,
focusedErrorBorder: InputBorder.none,
hintText: 'Full name',
hintStyle: TextStyle(color: Colors.grey[600]),
icon: Icon(Icons.account_circle, color: Colors.black),
),
onSaved: (string) => _formData['name'] = string,
validator: (string) {
if (string.isEmpty) {
return 'Field can\'t be empty';
}
return null;
},
),
),
),
),
)