Created
January 18, 2020 19:32
-
-
Save manojeeva/867634865f166921dbd397deb44a5e83 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String validator(String text) { | |
if (widget.validator == null) return null; | |
String error = widget.validator(text); | |
InputStatus inst; | |
if (error == null) | |
inst = InputStatus.valid; | |
else | |
inst = InputStatus.invalid; | |
if (inst != inputStatus) { | |
inputStatus = inst; | |
setInputDetails(error); | |
setState(() {}); | |
} | |
return error; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment