<p dir="auto">I have a search box with an attached clear button. When the clear button is pressed the search box should be cleared.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/7585117/27259037-cebddd5c-5401-11e7-9300-13f2399e6d05.png"><img src="https://user-images.githubusercontent.com/7585117/27259037-cebddd5c-5401-11e7-9300-13f2399e6d05.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">This is the <code class="notranslate">TextEditingController</code> &amp;  the <code class="notranslate">TextField</code> set up.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/7585117/27259057-5f2a067c-5402-11e7-8f4b-3388e18dba47.png"><img src="https://user-images.githubusercontent.com/7585117/27259057-5f2a067c-5402-11e7-8f4b-3388e18dba47.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/7585117/27259071-9e2e7d80-5402-11e7-8aea-49592a277da6.png"><img src="https://user-images.githubusercontent.com/7585117/27259071-9e2e7d80-5402-11e7-8aea-49592a277da6.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/7585117/27259080-cd3de458-5402-11e7-96d8-d2564164961b.png"><img src="https://user-images.githubusercontent.com/7585117/27259080-cd3de458-5402-11e7-96d8-d2564164961b.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">When the clear button is pressed the controller <code class="notranslate">clear()</code> method is called which results in an exception in the Android Simulator and on an actual device as well (Samsung Galaxy A3/Andoid 6.0.1).</p>
<p dir="auto">Framework • revision <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/flutter/flutter/commit/3b6d84b083956df5652b2fe34c68287579e9b73d/hovercard" href="https://github.com/flutter/flutter/commit/3b6d84b083956df5652b2fe34c68287579e9b73d"><tt>3b6d84b</tt></a> (2 days ago) • 2017-06-16 12:58:23 -0700<br>
Engine • revision <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/flutter/flutter/commit/784e9756720f7f6daa15c95ba3df6215bb54783f/hovercard" href="https://github.com/flutter/flutter/commit/784e9756720f7f6daa15c95ba3df6215bb54783f"><tt>784e975</tt></a> Tools • Dart 1.24.0-dev.6.7</p>
<p dir="auto">Let me know if you need any additional info.</p>
<p dir="auto">E/MethodChannel#flutter/textinput( 4187): Failed to handle method call<br>
E/MethodChannel#flutter/textinput( 4187): java.lang.IndexOutOfBoundsException: setSpan (-1 ... -1) starts before 0<br>
E/MethodChannel#flutter/textinput( 4187): 	at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1270)<br>
E/MethodChannel#flutter/textinput( 4187): 	at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:684)<br>
E/MethodChannel#flutter/textinput( 4187): 	at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:677)<br>
E/MethodChannel#flutter/textinput( 4187): 	at android.text.Selection.setSelection(Selection.java:76)<br>
E/MethodChannel#flutter/textinput( 4187): 	at io.flutter.plugin.editing.TextInputPlugin.setTextInputEditingState(TextInputPlugin.java:147)<br>
E/MethodChannel#flutter/textinput( 4187): 	at io.flutter.plugin.editing.TextInputPlugin.onMethodCall(TextInputPlugin.java:66)<br>
E/MethodChannel#flutter/textinput( 4187): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:191)<br>
E/MethodChannel#flutter/textinput( 4187): 	at io.flutter.view.FlutterView.handlePlatformMessage(FlutterView.java:643)<br>
E/MethodChannel#flutter/textinput( 4187): 	at android.os.MessageQueue.nativePollOnce(Native Method)<br>
E/MethodChannel#flutter/textinput( 4187): 	at android.os.MessageQueue.next(MessageQueue.java:323)<br>
E/MethodChannel#flutter/textinput( 4187): 	at android.os.Looper.loop(Looper.java:136)<br>
E/MethodChannel#flutter/textinput( 4187): 	at android.app.ActivityThread.main(ActivityThread.java:6119)<br>
E/MethodChannel#flutter/textinput( 4187): 	at java.lang.reflect.Method.invoke(Native Method)<br>
E/MethodChannel#flutter/textinput( 4187): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)<br>
E/MethodChannel#flutter/textinput( 4187): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)</p>
<p dir="auto">I hit it first after making minor changes to the flutter code lab, and am hitting it now, while trying to put together a simpler flutter app.</p>
<p dir="auto">Hot reload is not working, cold launches sometimes work.</p>
<p dir="auto">Flutter run from IJ.</p>
<p dir="auto">Launching lib/main.dart on Nexus 6P in debug mode...<br>
Built build/app/outputs/apk/app-debug.apk (21.7MB).<br>
W/IInputConnectionWrapper(21208): reportFullscreenMode on inexistent InputConnection<br>
I/flutter (21208): executeQuery<br>
Restarted app in 1,286ms.<br>
E/MethodChannel#flutter/textinput(21208): Failed to handle method call<br>
E/MethodChannel#flutter/textinput(21208): java.lang.IndexOutOfBoundsException: setSpan (-1 ... -1) starts before 0<br>
E/MethodChannel#flutter/textinput(21208): 	at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1325)<br>
E/MethodChannel#flutter/textinput(21208): 	at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:683)<br>
E/MethodChannel#flutter/textinput(21208): 	at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:676)<br>
E/MethodChannel#flutter/textinput(21208): 	at android.text.Selection.setSelection(Selection.java:76)<br>
E/MethodChannel#flutter/textinput(21208): 	at io.flutter.plugin.editing.TextInputPlugin.setTextInputEditingState(TextInputPlugin.java:147)<br>
E/MethodChannel#flutter/textinput(21208): 	at io.flutter.plugin.editing.TextInputPlugin.onMethodCall(TextInputPlugin.java:66)<br>
E/MethodChannel#flutter/textinput(21208): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:191)<br>
E/MethodChannel#flutter/textinput(21208): 	at io.flutter.view.FlutterView.handlePlatformMessage(FlutterView.java:643)<br>
E/MethodChannel#flutter/textinput(21208): 	at android.os.MessageQueue.nativePollOnce(Native Method)<br>
E/MethodChannel#flutter/textinput(21208): 	at android.os.MessageQueue.next(MessageQueue.java:323)<br>
E/MethodChannel#flutter/textinput(21208): 	at android.os.Looper.loop(Looper.java:136)<br>
E/MethodChannel#flutter/textinput(21208): 	at android.app.ActivityThread.main(ActivityThread.java:6121)<br>
E/MethodChannel#flutter/textinput(21208): 	at java.lang.reflect.Method.invoke(Native Method)<br>
E/MethodChannel#flutter/textinput(21208): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)<br>
E/MethodChannel#flutter/textinput(21208): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)</p>
<p dir="auto">flutter analyze:<br>
~/src/github/flutter/bin/flutter analyze<br>
Analyzing jwren/src/github/flutter_google_knowledge_graph...<br>
hint • The value of the local variable 'v' isn't used at lib/main.dart:97:9 • unused_local_variable<br>
1 issue found.<br>
(Ran in 4.5s)</p>