title: Flutter how to update hint text with current value in TextField
body: <p>I have a Textfield set up so when I click on it it clears the value -otherwise you have to delete the current value before you can type a new one. The problem is, when I click, the original hint text can be seen which can be quite confusing since it looks like it's been reset.</p>
  
  <blockquote>
    <p>So for example, the original hint text shows <code>25</code> in the text field, then I input a new value of <code>48</code>. But if I click again to input a new value once more, the original <code>25</code> hint text value is displayed again after it clears on focus.</p>
  </blockquote>
  
  <pre><code>  final TextEditingController control;
    final Function onchanged;
    FocusNode _focusNode;
  
    @override
    void initState() {
      super.initState();
      _focusNode = FocusNode();
      _focusNode.addListener(() {
        if (_focusNode.hasFocus) control.clear();
      });
    }
  
    TextField(
          focusNode: _focusNode,
          controller: control,
          onChanged: onchanged,
          decoration: InputDecoration(
            hintText: hint,
          ),
        ),
  </code></pre>
  
  <p>How can I make it so the hint text updates to the previous value (before it is cleared) so that when clicked it shows the same value? This is normal behaviour in form fields so I would like to achieve this.</p>