Make FormField._validate() return void (#30644)

None of its callers were using the return value, so no need to
invoke the `isValid` getter unnecessarily.
This commit is contained in:
Todd Volkert
2019-04-07 21:01:33 -07:00
committed by GitHub
parent 535523dbe0
commit cb78274c3f

View File

@@ -365,10 +365,9 @@ class FormFieldState<T> extends State<FormField<T>> {
return !hasError;
}
bool _validate() {
void _validate() {
if (widget.validator != null)
_errorText = widget.validator(_value);
return !hasError;
}
/// Updates this field's state to the new value. Useful for responding to