Flutter - Live textfield validation or validation on char lavel

691 Views Asked by At

I am not able to find how can I add live validation in flutter textfield. I want to show error message only when particular char is mismatch and not as soon as I start typing in textfield. I am trying to achieve something similar to Google Pay Bank Account link. Please check the below video to understand what I am trying to achieve.

I am not fully sure But we may achieve this using regex.

Screen Recording of expected output

2

There are 2 best solutions below

0
Fahmi Sawalha On

if i really understand what are you trying to do , you want to do a live validation on text input , i consider you use this package form_bloc, you can check this for some examples .

Hope that hepls

0
vikas pandey On

I am able to achieve this functionality by startsWith() method available in dart.