-2
I have a screen that needs to validate 2 fields. If one or both receive wrong values, return me one snackbar
with the error message. However, I would like to leave the field in red as soon as I return to snackbar, but I cannot make that return.
TextFormField(
// ignore: deprecated_member_use
controller: _emailController,
decoration: InputDecoration(
prefixIcon: Icon(
Icons.mail_outline,
color: greenColor,
),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
),
labelText: 'E-mail'),
validator: (email) {
if (!emailValid(email))
return _errorSnackBar(errorEmail);
return null;
},
)
Now with just an error message on return
the bar completely distorts