title: how to validate a form field based on the value of the other?
body: <p>I have 2 form fields,I want to validate the second form field to match the password from the first one,I tried but no success..thanks for answering.</p>
  
  <p>Updated : I already have submit button and its working,I want Validator in the second field to validate the first field text to match the second field.</p>
  
  <pre><code>            new TextFormField(
            controller: _registerPassController,
            decoration: new InputDecoration(labelText: 'Password'),
            obscureText: true,
            validator: (value) =&gt;
                value.isEmpty ? 'Password can\'t be empty' : null,
            onSaved: (value) =&gt; _password = value,
          ),
        ],
      ),
      new Stack(
        alignment: const Alignment(1.0, 1.0),
        children: &lt;Widget&gt;[
          new TextFormField(
            controller: _registerPassController2,
            decoration: new InputDecoration(labelText: 'Retype Password'),
            obscureText: true,
            validator: (value) {
              if (value.isEmpty) {
                return 'Please enter some text';
              }
            },),
  </code></pre>