onChanged: (v) async {
print(EmailValidator.validate(v));
EmailValidator.validate(v)
? () async {
print('email tureeee');
}
: () async {
print('email not trueee');
};
},
I have this conditional functions inside the onChange() of the TextField widget. print(EmailValidator.validate(v)); seems to work. However, the conditional function does not execute when condition has been met.
How can I make this work?
>Solution :
try this:
onChanged: (v) async {
print(EmailValidator.validate(v));
if(EmailValidator.validate(v)){
print('email tureeee');
}else{
print('email not trueee');
}
},