Skip to content

Instantly share code, notes, and snippets.

@manojeeva
Created January 18, 2020 19:32
Show Gist options
  • Save manojeeva/867634865f166921dbd397deb44a5e83 to your computer and use it in GitHub Desktop.
Save manojeeva/867634865f166921dbd397deb44a5e83 to your computer and use it in GitHub Desktop.
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