title: Flutter TextField - how to shrink the font if the text entered overflows
body: <p>I have a TextField (not a Text) widget that must remain on one line.  I want to reduce it's font size if the text entered is too large for the TextField box, ie shrink it if it overflows.  How can I do this?</p>
  
  <p>I have written some code like this in a stateful component</p>
  
  <pre><code>if (textLength &lt; 32) {
    newAutoTextVM.fontSize = 35.0;
  } else if (textLength &lt; 42) {
    newAutoTextVM.fontSize = 25.0;
  </code></pre>
  
  <p>In the view</p>
  
  <pre><code>fontSize: 25.0,
  </code></pre>
  
  <p>but it isn't very intelligent, it doesn't cope with resizing, also, because the font size isn't monospaced (courier etc), different characters take up different amounts of space.</p>