title: Subtract number value from TextFormField() with number value from Text() in real time while user is typing
body: <p>I have a <code>Text()</code> widget and a <code>TextFormField()</code> widget with <code>TextInputType.number</code>. What I want is when a user is typing in the <code>TextFormField()</code> <strong>subtraction math should be happening in real-time</strong>.</p>
  
  <p>The value entered in the <code>TextFormField()</code> should subtract the value inside the <code>Text()</code> widget automatically as the user is typing numbers inside the <code>TextFormField()</code>;</p>
  
  <p><strong>Note</strong> The final result should be shown in the same <code>Text()</code> widget as all of this typing and subtraction is happening.</p>
  
  <pre class="lang-dart prettyprint-override"><code>import 'package:flutter/material.dart';
  
  class ChangeValuesPage extends StatefulWidget {
  
    @override
    _ChangeValuesPageState createState() {
      return _ChangeValuesPageState();
    }
  }
  
  class _ChangeValuesPageState extends State&lt;ChangeValuesPage&gt; {
  
    final pureNumbers = RegExp(r'^[0-9]+$');
  
    int numberValue = 200;
    int latestNumberValue;
  
    final formKey = new GlobalKey&lt;FormState&gt;();
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: appbar(context, 'Simple App', 'otherData'),
        drawer: TopDrawer(),
        body: SingleChildScrollView(
          child: new Card(
            child: Padding(
              padding: EdgeInsets.all(5.0),
              child: new Column(
                children: &lt;Widget&gt;[
  /**
   * Below is the Text() field where subtraction math should occure.
   */
  /// The value in the Text() widget should be subtracted automatically with 
  /// the number values inside the TextFormField() widget automatically as the user is typing the numbers
                  Text(
                    'Number value text: ${this.numberValue}',
                    style: TextStyle(
                      fontSize: 20,
                      fontWeight: FontWeight.bold,
                    ),
                  ),
                  SizedBox(
                    height: 6,
                  ),
                  new Form(
                    key: formKey,
                    child: new Column(
                      children: &lt;Widget&gt;[
                        TextFormField(
                          keyboardType: TextInputType.number,
                          decoration: new InputDecoration(
                            labelText: 'Reduce number value?',
                            hintText: 'Default number value is "0"',
                          ),
                          validator: (val) {
                            if (val.isEmpty == true) {
                              return 'Fill in number values';
                            }
                            if (pureNumbers.hasMatch(val) == false) {
                              return 'Use alphanumeric characters only in nickname';
                            }
                            return null;
                          },
                          onSaved: (val) =&gt; this.latestNumberValue = int.parse(val),
                        ),
                      ],
                    ),
                  ),
                ],
              ),
            ),
          ),
        ),
      );
    }
  }
  </code></pre>
  
  <p>I have tried different ways to achieve this but nothing is working. Thank you, posted with Love.</p>