<p dir="auto">A common UI pattern is having a text field which grows vertically, adding more lines, as you type, up to a certain number of lines, after which the content scrolls.</p>
<p dir="auto">Presently, we can have a growing <code class="notranslate">TextField</code> by making <code class="notranslate">maxLines=null</code>. However, then the <code class="notranslate">TextField</code> never stops growing. Otherwise, if we make, say, <code class="notranslate">maxLines=6</code>, then it will have 6 fixed lines, and will not grow.</p>
<p dir="auto">Unfortunatelly, <code class="notranslate">maxLines</code> was a bad name. That should have been called simply "lines", since it fixes the number of lines, and is not a maximum. However, that cannot be changed anymore.</p>
<p dir="auto">I will now suggest adding another parameter, called <code class="notranslate">maxLineLimit</code>, which lets the number of lines grow until that number and then no more. And while we're at that, I would also add the less important <code class="notranslate">minLineLimit</code>.</p>
<p dir="auto">So, for example, if we make <code class="notranslate">maxLines=null, minLineLimit=2, maxLineLimit=6</code>, then the <code class="notranslate">TextField</code> starts with 2 lines, and, if necessary to fit the text, grows until 6 lines. After that it scrolls.</p>
<p dir="auto">This change is very easy to do, in file <code class="notranslate">editable.dart</code>, the method <code class="notranslate">_preferredHeight</code> in <code class="notranslate">class RenderEditable</code> has these last 2 lines:</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    _layoutText(width);
    return math.max(preferredLineHeight, _textPainter.height);"><pre class="notranslate">    <span class="pl-en">_layoutText</span>(width);
    <span class="pl-k">return</span> math.<span class="pl-en">max</span>(preferredLineHeight, _textPainter.height);</pre></div>
<p dir="auto">These could be simply changed to:</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="      _layoutText(width);
      return math.min(preferredLineHeight * maxLineLimit, math.max(preferredLineHeight * minLineLimit, _textPainter.height));"><pre class="notranslate">      <span class="pl-en">_layoutText</span>(width);
      <span class="pl-k">return</span> math.<span class="pl-en">min</span>(preferredLineHeight <span class="pl-k">*</span> maxLineLimit, math.<span class="pl-en">max</span>(preferredLineHeight <span class="pl-k">*</span> minLineLimit, _textPainter.height));</pre></div>
<h2 dir="auto">Steps to Reproduce</h2>
<p dir="auto">I have a flutter app which using <code class="notranslate">cached_network_image</code> to display image and using <code class="notranslate">video_player</code> to display video. The image and video display correctly when debug in simulator on a MacBook Pro which set a system proxy to access foreign http resources, as I'm in China! But when build a release ipa and install on my iPhone which have a VPN to proxy foreign http resources, the image and video can't be displayed. I can browse these resources in Chrome app.</p>
<h2 dir="auto">Logs</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[✓] Flutter (Channel beta, v0.7.3, on Mac OS X 10.13.6 17G65, locale zh-Hans-CN)
    • Flutter version 0.7.3 at /Users/jagger/flutter
    • Framework revision 3b309bda07 (13 days ago), 2018-08-28 12:39:24 -0700
    • Engine revision af42b6dc95
    • Dart version 2.1.0-dev.1.0.flutter-ccb16f7282

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/jagger/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • ANDROID_HOME = /Users/jagger/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.4.1, Build version 9F2000
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 27.1.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] VS Code (version 1.27.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.18.0

[!] Connected devices
    ! No devices available

! Doctor found issues in 1 category."><pre class="notranslate"><code class="notranslate">[✓] Flutter (Channel beta, v0.7.3, on Mac OS X 10.13.6 17G65, locale zh-Hans-CN)
    • Flutter version 0.7.3 at /Users/jagger/flutter
    • Framework revision 3b309bda07 (13 days ago), 2018-08-28 12:39:24 -0700
    • Engine revision af42b6dc95
    • Dart version 2.1.0-dev.1.0.flutter-ccb16f7282

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/jagger/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • ANDROID_HOME = /Users/jagger/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.4.1, Build version 9F2000
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 27.1.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] VS Code (version 1.27.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.18.0

[!] Connected devices
    ! No devices available

! Doctor found issues in 1 category.
</code></pre></div>