title: Is there a way to dynamically change the Flutter TextField's maxLines?
body: <p>I have a TextField like this:</p>
  
  <pre><code>new Flexible(
      fit: FlexFit.loose,
      child: new Container(
          alignment: FractionalOffset.topLeft,
          child: new TextField(
              decoration: new InputDecoration(
                    hintText: 'Add a note',
              ),
              maxLines: 1,
              onChanged: (value) =&gt; _showSaveOptions(value),
          ),
      ),
  ),
  </code></pre>
  
  <p>I'd like to have my TextField to start out with <code>maxLines</code> set to 1, but as I type, I would like the maxLines to increase, so that all the text remains on the page and I don't have to scroll up. However, I also don't want to start off with <code>maxLines</code> set to say, 5 or 10, because the empty TextField takes up more space that necessary. An example of the behavior I want to implement is in the Long Answer Text option in Google Forms, where it starts with one line:
  <a href="https://i.stack.imgur.com/EDeT4.png" rel="noreferrer"><img src="https://i.stack.imgur.com/EDeT4.png" alt="enter image description here"></a>
  and expands as I type:
  <a href="https://i.stack.imgur.com/zOf8s.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zOf8s.png" alt="enter image description here"></a></p>
  
  <p>I've considered setting <code>maxLines</code> to a counter that increments every time the user hits a newline, but how do I determine when the user has filled up a line?</p>