title: Flutter TextFormField onSave() doesn't get called after successful validation
body: <p>I have a weird problem in flutter TextFormField. I implemented form validation in TextFormField. But onSaved() function doesn't get called after successful validation.</p>
  
  <p>First I created basic Widget using TextFormField</p>
  
  <p>--- In AppWidgets class ---</p>
  
  <pre><code>  static Widget buildTextFormField(
      String labelText,
      String helperText,
      IconData prefixIcon, {
      Widget suffixIcon,
      bool obscureText = false,
      TextInputType keyboardType = TextInputType.text,
      TextInputAction textInputAction = TextInputAction.none,
      FocusNode focusNode,
      ValueChanged&lt;String&gt; onFieldSubmitted,
      TextEditingController controller,
      FormFieldValidator&lt;String&gt; validator,
      FormFieldSetter&lt;String&gt; onSaved,
      bool isLightTheme = false,
    }) {
      return Theme(
        data: isLightTheme
            ? AppThemesLight.textFormFieldThemeData
            : AppThemesDark.textFormFieldThemeData,
        child: TextFormField(
          controller: controller,
          validator: validator,
          onSaved: onSaved,
          keyboardType: keyboardType,
          textInputAction: textInputAction,
          focusNode: focusNode,
          onFieldSubmitted: onFieldSubmitted,
          obscureText: obscureText,
          decoration: InputDecoration(
            filled: true,
            fillColor: isLightTheme
                ? AppColorsLight.textFieldFillColor
                : AppColorsDark.textFieldFillColor,
            labelText: labelText,
            helperText: helperText,
            border: OutlineInputBorder(
              borderRadius: BorderRadius.all(
                Radius.circular(AppDimensions.textFieldBorderRadius),
              ),
            ),
            prefixIcon: Icon(
              prefixIcon,
              color: isLightTheme
                  ? AppColorsLight.primaryTextColor
                  : AppColorsDark.primaryTextColor,
            ),
            suffixIcon: suffixIcon,
          ),
        ),
      );
    }
  </code></pre>
  
  <p>From that, created email text from field.</p>
  
  <pre><code>  static Widget buildEmailTextFormField(LoginState loginState) {
      return AppWidgets.buildTextFormField(
        'Email address',
        'Your email address',
        Icons.email,
        keyboardType: TextInputType.emailAddress,
        textInputAction: TextInputAction.next,
        focusNode: loginState.focusNodes[0],
        onFieldSubmitted: (String value) {
          print('submitted $value');
          loginState.onFocusChanged(index: 0);
        },
        validator: (String email) {
          print('validator $email');
          return InputValidators.validateEmail(email);
        },
        onSaved: (String email) {
          print('saved $email');
          loginState.email = email;
        },
      );
    }
  </code></pre>
  
  <p>Here is the email validator I used.</p>
  
  <pre><code>  static String validateEmail(String email) {
      Pattern pattern =
          r'^(([^&lt;&gt;()[\]\\.,;:\s@\"]+(\.[^&lt;&gt;()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$';
      RegExp regex = new RegExp(pattern);
      if (email.isEmpty)
        return 'Email can\'t be empty';
      else if (!regex.hasMatch(email))
        return 'Enter valid email address';
      else
        return null;
    }
  </code></pre>
  
  <p>I tested above code by putting print statement inside onSaved() function, but it's not printing after successful validation.</p>