Repository: flutter
Issue: TextFormField -> TextEditingValue -> oldValue.selection and oldValue.composing are wrong with Gboard!
Labels: a: text input,framework,f: material design,has reproducible steps,found in release: 2.3,team-design,triaged-design

## Steps to Reproduce

1. Run `flutter create flutter_sandbox`.
2. Update the files as follows: 
Add `intl` to dependencies of `pubspec.yaml`
Copy/paste the following into `main.dart`:


<details>
<summary>code sample</summary>

```dart
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:intl/intl.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final myTextController = TextEditingController();
  final decimalNumberTextInputFormatter = DecimalNumberTextInputFormatter();

  initState() {
    super.initState();
    myTextController.text = '123,456';
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Gboard bug'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text('After pressing backspace...\n'),
            Text('Cursor is in the wrong location with:'),
            Text('  Gboard keyboard and autofocus: true.\n'),
            Text('Cursor is in the correct location with:'),
            Text('  Microsoft SwiftKey keyboard or autofocus: false.\n'),
            TextFormField(
              controller: myTextController,
              inputFormatters: [
                decimalNumberTextInputFormatter,
              ],
              keyboardType: TextInputType.number,
              autofocus: true,
            ),
          ],
        ),
      ),
    );
  }
}

class DecimalNumberTextInputFormatter extends TextInputFormatter {
  @override
  TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) {
    print('');
    print('oldValue.text:                   ${oldValue.text}');
    print('oldValue.text.length:            ${oldValue.text.length}');
    print('oldValue.selection.start:        ${oldValue.selection.start}');
    print('oldValue.selection.end:          ${oldValue.selection.end}');
    print('oldValue.selection.baseOffset:   ${oldValue.selection.baseOffset}');
    print('oldValue.selection.extentOffset: ${oldValue.selection.extentOffset}');
    print('oldValue.selection.isValid:      ${oldValue.selection.isValid}');
    print('oldValue.selection.isDirectional:${oldValue.selection.isDirectional}');
    print('oldValue.selection.affinity:     ${oldValue.selection.affinity}');
    print('oldValue.composing.start:        ${oldValue.composing.start}');
    print('oldValue.composing.end:          ${oldValue.composing.end}');
    print('oldValue.composing.isValid:      ${oldValue.composing.isValid}');
    print('oldValue.composing.isCollapsed:  ${oldValue.composing.isCollapsed}');
    print('oldValue.composing.isNormalized: ${oldValue.composing.isNormalized}');

    // Check for no change
    if (newValue.text.compareTo(oldValue.text) == 0) {
      return oldValue;
    }

    String newString = _formattedNewValue(oldValue, newValue);

    int cursorLocationFromEnd;
    if (oldValue.selection.end < 0) {
      cursorLocationFromEnd = 0;
    } else {
      cursorLocationFromEnd = oldValue.text.length - oldValue.selection.end;
    }
    final int cursorLocation = newString.length - cursorLocationFromEnd;
    print('new cursor location: $cursorLocation');

    return TextEditingValue(
      text: newString,
      selection: TextSelection.collapsed(
        offset: cursorLocation,
      ),
    );
  }

  String _formattedNewValue(TextEditingValue oldValue, TextEditingValue newValue) {
    String _digitsAndDots = newValue.text.replaceAll(RegExp(r'((?!\d|\.).)*'), '');
    if (_digitsAndDots == '') {
      return '';
    }

    // Remove all non-digits
    final String stripped = _digitsAndDots.replaceAll(RegExp(r'\D'), '');

    // Check for zero
    if (double.tryParse(stripped) == 0.0) {
      return '0';
    }

    final int intNum = int.tryParse(stripped);

    // Check for blank field
    if (intNum == null) {
      return '';
    }

    final currencyFormat = NumberFormat('#,##0', 'en_US');
    final String newString = currencyFormat.format(intNum);

    return newString;
  }
}
```
</details>



3. Debug the program on an Android device or Android emulator
4. Press the backspace key
**The cursor is in the wrong location!**  The cursor moves one digit to the left after deleting the rightmost digit.



**Expected results:** <!-- what did you want to see? -->
![Screenshot from 2021-04-27 13-07-14](https://user-images.githubusercontent.com/5922273/116283116-862dab80-a759-11eb-8b7a-ee16ddc5c7a5.png)
```
I/flutter (31491):
I/flutter (31491): oldValue.text:                   123,456
I/flutter (31491): oldValue.text.length:            7
I/flutter (31491): oldValue.selection.start:        7
I/flutter (31491): oldValue.selection.end:          7
I/flutter (31491): oldValue.selection.baseOffset:   7
I/flutter (31491): oldValue.selection.extentOffset: 7
I/flutter (31491): oldValue.selection.isValid:      true
I/flutter (31491): oldValue.selection.isDirectional:false
I/flutter (31491): oldValue.selection.affinity:     TextAffinity.downstream
I/flutter (31491): oldValue.composing.start:        0
I/flutter (31491): oldValue.composing.end:          7
I/flutter (31491): oldValue.composing.isValid:      true
I/flutter (31491): oldValue.composing.isCollapsed:  false
I/flutter (31491): oldValue.composing.isNormalized: true
I/flutter (31491): new cursor location: 6

```
**Actual results:**
![Screenshot from 2021-04-27 13-05-18](https://user-images.githubusercontent.com/5922273/116282947-5aaac100-a759-11eb-8bfb-e8700e36696b.png)
```
I/flutter (31491):
I/flutter (31491): oldValue.text:                   123,456
I/flutter (31491): oldValue.text.length:            7
I/flutter (31491): oldValue.selection.start:        6
I/flutter (31491): oldValue.selection.end:          6
I/flutter (31491): oldValue.selection.baseOffset:   6
I/flutter (31491): oldValue.selection.extentOffset: 6
I/flutter (31491): oldValue.selection.isValid:      true
I/flutter (31491): oldValue.selection.isDirectional:false
I/flutter (31491): oldValue.selection.affinity:     TextAffinity.downstream
I/flutter (31491): oldValue.composing.start:        -1
I/flutter (31491): oldValue.composing.end:          -1
I/flutter (31491): oldValue.composing.isValid:      false
I/flutter (31491): oldValue.composing.isCollapsed:  true
I/flutter (31491): oldValue.composing.isNormalized: true
I/flutter (31491): new cursor location: 5

```
This problem occurs when using the _Gboard_ keyboard on **Android** when autofocus is set to true.
This problem does not occur when using _Microsoft SwiftKey_ keyboard on Android.
This problem does not occur when autofocus is set to false.
This problem does not occur when run on the web.
(I haven't tested iOS.)

<details>
  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue.
-->

```
user1@computer1:~/git_projects/flutter_sandbox$ flutter run --verbose
[  +59 ms] executing: [/home/user1/development/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +29 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] adc687823a831bbebe28bdccfac1a628ca621513
[        ] executing: [/home/user1/development/flutter/] git tag --points-at adc687823a831bbebe28bdccfac1a628ca621513
[  +22 ms] Exit code 0 from: git tag --points-at adc687823a831bbebe28bdccfac1a628ca621513
[        ] 2.0.5
[  +51 ms] executing: [/home/user1/development/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[   +4 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/stable
[        ] executing: [/home/user1/development/flutter/] git ls-remote --get-url origin
[   +4 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +43 ms] executing: [/home/user1/development/flutter/] git rev-parse --abbrev-ref HEAD
[   +5 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[  +62 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +1 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +49 ms] executing: /home/user1/Android/platform-tools/adb devices -l
[  +57 ms] List of devices attached
           emulator-5554          device product:sdk_gphone_x86 model:Android_SDK_built_for_x86 device:generic_x86 transport_id:5
[   +6 ms] /home/user1/Android/platform-tools/adb -s emulator-5554 shell getprop
[  +43 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +63 ms] Skipping pub get: version match.
[ +105 ms] Generating /home/user1/git_projects/flutter_sandbox/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
[  +59 ms] ro.hardware = ranchu
[  +11 ms] Using hardware rendering with device Android SDK built for x86. If you notice graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
[  +26 ms] Initializing file store
[  +11 ms] Skipping target: gen_localizations
[   +8 ms] complete
[   +4 ms] Launching lib/main.dart on Android SDK built for x86 in debug mode...
[   +4 ms] /home/user1/development/flutter/bin/cache/dart-sdk/bin/dart --disable-dart-dev /home/user1/development/flutter/bin/cache/artifacts/engine/linux-x64/frontend_server.dart.snapshot
--sdk-root /home/user1/development/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk/ --incremental --target=flutter --debugger-module-names --experimental-emit-debug-metadata
--output-dill /tmp/flutter_tools.LULRBL/flutter_tool.LIFTNQ/app.dill --packages /home/user1/git_projects/flutter_sandbox/.dart_tool/package_config.json -Ddart.vm.profile=false
-Ddart.vm.product=false --enable-asserts --track-widget-creation --filesystem-scheme org-dartlang-root --initialize-from-dill build/cache.dill.track.dill
[  +26 ms] executing: /home/user1/Android/build-tools/29.0.2/aapt dump xmltree /home/user1/git_projects/flutter_sandbox/build/app/outputs/flutter-apk/app.apk AndroidManifest.xml
[  +32 ms] Exit code 0 from: /home/user1/Android/build-tools/29.0.2/aapt dump xmltree /home/user1/git_projects/flutter_sandbox/build/app/outputs/flutter-apk/app.apk AndroidManifest.xml
[        ] N: android=http://schemas.android.com/apk/res/android
             E: manifest (line=2)
               A: android:versionCode(0x0101021b)=(type 0x10)0x1
               A: android:versionName(0x0101021c)="1.0.0" (Raw: "1.0.0")
               A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1e
               A: android:compileSdkVersionCodename(0x01010573)="11" (Raw: "11")
               A: package="com.example.flutter_sandbox" (Raw: "com.example.flutter_sandbox")
               A: platformBuildVersionCode=(type 0x10)0x1e
               A: platformBuildVersionName=(type 0x10)0xb
               E: uses-sdk (line=7)
                 A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10
                 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1e
               E: uses-permission (line=14)
                 A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET")
               E: application (line=16)
                 A: android:label(0x01010001)="flutter_sandbox" (Raw: "flutter_sandbox")
                 A: android:icon(0x01010002)=@0x7f080000
                 A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
                 A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw: "androidx.core.app.CoreComponentFactory")
                 E: activity (line=21)
                   A: android:theme(0x01010000)=@0x7f0a0000
                   A: android:name(0x01010003)="com.example.flutter_sandbox.MainActivity" (Raw: "com.example.flutter_sandbox.MainActivity")
                   A: android:launchMode(0x0101001d)=(type 0x10)0x1
                   A: android:configChanges(0x0101001f)=(type 0x11)0x40003fb4
                   A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10
                   A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff
                   E: meta-data (line=35)
                     A: android:name(0x01010003)="io.flutter.embedding.android.NormalTheme" (Raw: "io.flutter.embedding.android.NormalTheme")
                     A: android:resource(0x01010025)=@0x7f0a0001
                   E: meta-data (line=45)
                     A: android:name(0x01010003)="io.flutter.embedding.android.SplashScreenDrawable" (Raw: "io.flutter.embedding.android.SplashScreenDrawable")
                     A: android:resource(0x01010025)=@0x7f040000
                   E: intent-filter (line=49)
                     E: action (line=50)
                       A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
                     E: category (line=52)
                       A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER")
                 E: meta-data (line=59)
                   A: android:name(0x01010003)="flutterEmbedding" (Raw: "flutterEmbedding")
                   A: android:value(0x01010024)=(type 0x10)0x2
[   +7 ms] executing: /home/user1/Android/platform-tools/adb -s emulator-5554 shell -x logcat -v time -t 1
[  +28 ms] <- compile package:flutter_sandbox/main.dart
[  +44 ms] --------- beginning of main
           04-27 13:13:49.795 I/qemu-props( 1407): start adbd ...
[  +45 ms] executing: /home/user1/Android/platform-tools/adb version
[  +29 ms] Android Debug Bridge version 1.0.41
           Version 31.0.2-7242960
           Installed as /home/user1/Android/platform-tools/adb
[  +10 ms] executing: /home/user1/Android/platform-tools/adb start-server
[  +74 ms] Building APK
[  +34 ms] Running Gradle task 'assembleDebug'...
[  +13 ms] Using gradle from /home/user1/git_projects/flutter_sandbox/android/gradlew.
[        ] /home/user1/git_projects/flutter_sandbox/android/gradlew mode: 33277 rwxrwxr-x.
[  +17 ms] executing: /opt/android-studio/jre/bin/java -version
[ +244 ms] Exit code 0 from: /opt/android-studio/jre/bin/java -version
[   +1 ms] openjdk version "1.8.0_242-release"
           OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
           OpenJDK 64-Bit Server VM (build 25.242-b3-6222593, mixed mode)
[   +3 ms] executing: [/home/user1/git_projects/flutter_sandbox/android/] /home/user1/git_projects/flutter_sandbox/android/gradlew -Pverbose=true -Ptarget-platform=android-x86
-Ptarget=/home/user1/git_projects/flutter_sandbox/lib/main.dart -Ptrack-widget-creation=true -Pfilesystem-scheme=org-dartlang-root assembleDebug
[ +919 ms] Welcome to Gradle 6.7!
[  +12 ms] Here are the highlights of this release:
[        ]  - File system watching is ready for production use
[        ]  - Declare the version of Java your build requires
[        ]  - Java 15 support
[        ] For more details see https://docs.gradle.org/6.7/release-notes.html
[+3359 ms] > Task :app:compileFlutterBuildDebug
[        ] [  +68 ms] executing: [/home/user1/development/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] [  +33 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +7 ms] [        ] adc687823a831bbebe28bdccfac1a628ca621513
[        ] [        ] executing: [/home/user1/development/flutter/] git tag --points-at adc687823a831bbebe28bdccfac1a628ca621513
[        ] [  +12 ms] Exit code 0 from: git tag --points-at adc687823a831bbebe28bdccfac1a628ca621513
[        ] [        ] 2.0.5
[        ] [  +39 ms] executing: [/home/user1/development/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[        ] [   +5 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] [        ] origin/stable
[        ] [        ] executing: [/home/user1/development/flutter/] git ls-remote --get-url origin
[        ] [   +5 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] [        ] https://github.com/flutter/flutter.git
[        ] [  +37 ms] executing: [/home/user1/development/flutter/] git rev-parse --abbrev-ref HEAD
[        ] [  +18 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] [        ] stable
[        ] [  +48 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] [  +10 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] [   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] [   +1 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[        ] [  +70 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[        ] [        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[        ] [        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[   +1 ms] [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[        ] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] [   +4 ms] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[        ] [  +51 ms] Initializing file store
[        ] [  +11 ms] Skipping target: gen_localizations
[        ] [   +5 ms] kernel_snapshot: Starting due to {}
[        ] [   +8 ms] /home/user1/development/flutter/bin/cache/dart-sdk/bin/dart --disable-dart-dev
/home/user1/development/flutter/bin/cache/artifacts/engine/linux-x64/frontend_server.dart.snapshot --sdk-root
/home/user1/development/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk/ --target=flutter --no-print-incremental-dependencies -Ddart.vm.profile=false -Ddart.vm.product=false
--enable-asserts --track-widget-creation --no-link-platform --packages /home/user1/git_projects/flutter_sandbox/.dart_tool/package_config.json --output-dill
/home/user1/git_projects/flutter_sandbox/.dart_tool/flutter_build/8b95918160bfea09ee86214ad3b0efd9/app.dill --depfile
/home/user1/git_projects/flutter_sandbox/.dart_tool/flutter_build/8b95918160bfea09ee86214ad3b0efd9/kernel_snapshot.d package:flutter_sandbox/main.dart
[+7179 ms] [+8424 ms] kernel_snapshot: Complete
[ +400 ms] [ +394 ms] debug_android_application: Starting due to {}
[ +299 ms] [ +248 ms] debug_android_application: Complete
[ +400 ms] [ +457 ms] Persisting file store
[ +100 ms] [   +5 ms] Done persisting file store
[        ] [   +4 ms] build succeeded.
[        ] [   +9 ms] "flutter assemble" took 9,735ms.
[        ] [   +3 ms] ensureAnalyticsSent: 0ms
[        ] [   +1 ms] Running shutdown hooks
[        ] [        ] Shutdown hooks complete
[        ] [        ] exiting with code 0
[  +96 ms] > Task :app:packLibsflutterBuildDebug UP-TO-DATE
[   +1 ms] > Task :app:preBuild UP-TO-DATE
[  +98 ms] > Task :app:preDebugBuild UP-TO-DATE
[        ] > Task :app:compileDebugAidl NO-SOURCE
[        ] > Task :app:compileDebugRenderscript NO-SOURCE
[        ] > Task :app:generateDebugBuildConfig UP-TO-DATE
[ +200 ms] > Task :app:checkDebugAarMetadata UP-TO-DATE
[        ] > Task :app:cleanMergeDebugAssets
[        ] > Task :app:mergeDebugShaders UP-TO-DATE
[        ] > Task :app:compileDebugShaders NO-SOURCE
[        ] > Task :app:generateDebugAssets UP-TO-DATE
[        ] > Task :app:mergeDebugAssets
[ +199 ms] > Task :app:copyFlutterAssetsDebug
[        ] > Task :app:generateDebugResValues UP-TO-DATE
[        ] > Task :app:generateDebugResources UP-TO-DATE
[        ] > Task :app:mergeDebugResources UP-TO-DATE
[ +101 ms] > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
[        ] > Task :app:extractDeepLinksDebug UP-TO-DATE
[        ] > Task :app:processDebugMainManifest UP-TO-DATE
[        ] > Task :app:processDebugManifest UP-TO-DATE
[        ] > Task :app:processDebugManifestForPackage UP-TO-DATE
[  +96 ms] > Task :app:processDebugResources UP-TO-DATE
[ +100 ms] > Task :app:compileDebugKotlin UP-TO-DATE
[   +1 ms] > Task :app:javaPreCompileDebug UP-TO-DATE
[   +2 ms] > Task :app:compileDebugJavaWithJavac UP-TO-DATE
[   +1 ms] > Task :app:compileDebugSources UP-TO-DATE
[        ] > Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
[        ] > Task :app:processDebugJavaRes NO-SOURCE
[        ] > Task :app:mergeDebugJavaResource UP-TO-DATE
[  +91 ms] > Task :app:checkDebugDuplicateClasses UP-TO-DATE
[   +1 ms] > Task :app:dexBuilderDebug UP-TO-DATE
[        ] > Task :app:desugarDebugFileDependencies UP-TO-DATE
[  +97 ms] > Task :app:mergeExtDexDebug UP-TO-DATE
[   +1 ms] > Task :app:mergeDexDebug UP-TO-DATE
[        ] > Task :app:mergeDebugJniLibFolders UP-TO-DATE
[   +1 ms] > Task :app:mergeDebugNativeLibs UP-TO-DATE
[        ] > Task :app:stripDebugDebugSymbols UP-TO-DATE
[        ] > Task :app:validateSigningDebug UP-TO-DATE
[ +394 ms] > Task :app:compressDebugAssets
[ +700 ms] > Task :app:packageDebug
[ +277 ms] > Task :app:assembleDebug
[        ] Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
[        ] Use '--warning-mode all' to show the individual deprecation warnings.
[        ] See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings
[        ] BUILD SUCCESSFUL in 14s
[        ] 32 actionable tasks: 7 executed, 25 up-to-date
[ +343 ms] Running Gradle task 'assembleDebug'... (completed in 15.8s)
[ +207 ms] calculateSha: LocalDirectory: '/home/user1/git_projects/flutter_sandbox/build/app/outputs/flutter-apk'/app.apk
[  +27 ms] calculateSha: reading file took 26us
[ +533 ms] calculateSha: computing sha took 532us
[   +4 ms] ✓ Built build/app/outputs/flutter-apk/app-debug.apk.
[   +3 ms] executing: /home/user1/Android/build-tools/29.0.2/aapt dump xmltree /home/user1/git_projects/flutter_sandbox/build/app/outputs/flutter-apk/app.apk AndroidManifest.xml
[   +8 ms] Exit code 0 from: /home/user1/Android/build-tools/29.0.2/aapt dump xmltree /home/user1/git_projects/flutter_sandbox/build/app/outputs/flutter-apk/app.apk AndroidManifest.xml
[        ] N: android=http://schemas.android.com/apk/res/android
             E: manifest (line=2)
               A: android:versionCode(0x0101021b)=(type 0x10)0x1
               A: android:versionName(0x0101021c)="1.0.0" (Raw: "1.0.0")
               A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1e
               A: android:compileSdkVersionCodename(0x01010573)="11" (Raw: "11")
               A: package="com.example.flutter_sandbox" (Raw: "com.example.flutter_sandbox")
               A: platformBuildVersionCode=(type 0x10)0x1e
               A: platformBuildVersionName=(type 0x10)0xb
               E: uses-sdk (line=7)
                 A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10
                 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1e
               E: uses-permission (line=14)
                 A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET")
               E: application (line=16)
                 A: android:label(0x01010001)="flutter_sandbox" (Raw: "flutter_sandbox")
                 A: android:icon(0x01010002)=@0x7f080000
                 A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
                 A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw: "androidx.core.app.CoreComponentFactory")
                 E: activity (line=21)
                   A: android:theme(0x01010000)=@0x7f0a0000
                   A: android:name(0x01010003)="com.example.flutter_sandbox.MainActivity" (Raw: "com.example.flutter_sandbox.MainActivity")
                   A: android:launchMode(0x0101001d)=(type 0x10)0x1
                   A: android:configChanges(0x0101001f)=(type 0x11)0x40003fb4
                   A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10
                   A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff
                   E: meta-data (line=35)
                     A: android:name(0x01010003)="io.flutter.embedding.android.NormalTheme" (Raw: "io.flutter.embedding.android.NormalTheme")
                     A: android:resource(0x01010025)=@0x7f0a0001
                   E: meta-data (line=45)
                     A: android:name(0x01010003)="io.flutter.embedding.android.SplashScreenDrawable" (Raw: "io.flutter.embedding.android.SplashScreenDrawable")
                     A: android:resource(0x01010025)=@0x7f040000
                   E: intent-filter (line=49)
                     E: action (line=50)
                       A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
                     E: category (line=52)
                       A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER")
                 E: meta-data (line=59)
                   A: android:name(0x01010003)="flutterEmbedding" (Raw: "flutterEmbedding")
                   A: android:value(0x01010024)=(type 0x10)0x2
[   +1 ms] Stopping app 'app.apk' on Android SDK built for x86.
[        ] executing: /home/user1/Android/platform-tools/adb -s emulator-5554 shell am force-stop com.example.flutter_sandbox
[  +67 ms] executing: /home/user1/Android/platform-tools/adb -s emulator-5554 shell pm list packages com.example.flutter_sandbox
[ +573 ms] package:com.example.flutter_sandbox
[   +2 ms] executing: /home/user1/Android/platform-tools/adb -s emulator-5554 shell cat /data/local/tmp/sky.com.example.flutter_sandbox.sha1
[  +17 ms] abe306cef3d8192a5688cccf8fb3804d4360b859
[        ] Installing APK.
[   +1 ms] Installing build/app/outputs/flutter-apk/app.apk...
[        ] executing: /home/user1/Android/platform-tools/adb -s emulator-5554 install -t -r /home/user1/git_projects/flutter_sandbox/build/app/outputs/flutter-apk/app.apk
[+1780 ms] Performing Streamed Install
                    Success
[   +1 ms] Installing build/app/outputs/flutter-apk/app.apk... (completed in 1,780ms)
[        ] executing: /home/user1/Android/platform-tools/adb -s emulator-5554 shell echo -n 9267b3aefa9a04aa3c6e41b8e0d468d5866cdb4e > /data/local/tmp/sky.com.example.flutter_sandbox.sha1
[  +30 ms] executing: /home/user1/Android/platform-tools/adb -s emulator-5554 shell -x logcat -v time -t 1
[ +265 ms] --------- beginning of main
                    04-27 13:14:09.295 D/CarrierSvcBindHelper( 1824): No carrier app for: 0
[   +7 ms] executing: /home/user1/Android/platform-tools/adb -s emulator-5554 shell am start -a android.intent.action.RUN -f 0x20000000 --ez enable-background-compilation true --ez
enable-dart-profiling true --ez enable-checked-mode true --ez verify-entry-points true com.example.flutter_sandbox/com.example.flutter_sandbox.MainActivity
[ +176 ms] Starting: Intent { act=android.intent.action.RUN flg=0x20000000 cmp=com.example.flutter_sandbox/.MainActivity (has extras) }
[        ] Waiting for observatory port to be available...
[+3465 ms] Observatory URL on device: http://127.0.0.1:47832/tXCbtI-7Ksc=/
[   +1 ms] executing: /home/user1/Android/platform-tools/adb -s emulator-5554 forward tcp:0 tcp:47832
[  +10 ms] 32951
[        ] Forwarded host port 32951 to device port 47832 for Observatory
[   +4 ms] Caching compiled dill
[ +231 ms] Connecting to service protocol: http://127.0.0.1:32951/tXCbtI-7Ksc=/
[ +264 ms] Activating Dart DevTools...
[ +103 ms] Launching a Dart Developer Service (DDS) instance at http://127.0.0.1:0, connecting to VM service at http://127.0.0.1:32951/tXCbtI-7Ksc=/.
[ +353 ms] DDS is listening at http://127.0.0.1:38695/Hos4fuXy4Zs=/.
[  +82 ms] Successfully connected to service protocol: http://127.0.0.1:32951/tXCbtI-7Ksc=/
[+1853 ms] Activating Dart DevTools... (completed in 2,393ms)
[ +637 ms] DevFS: Creating new filesystem on the device (null)
[  +25 ms] DevFS: Created new filesystem on the device (file:///data/user/0/com.example.flutter_sandbox/code_cache/flutter_sandboxKXBOVV/flutter_sandbox/)
[   +4 ms] Updating assets
[  +88 ms] Syncing files to device Android SDK built for x86...
[   +1 ms] <- reset
[        ] Compiling dart to kernel with 0 updated files
[   +5 ms] <- recompile package:flutter_sandbox/main.dart 21c0cac4-cc35-458c-8be9-4b6d91646ed9
[        ] <- 21c0cac4-cc35-458c-8be9-4b6d91646ed9
[ +334 ms] Updating files.
[        ] DevFS: Sync finished
[   +1 ms] Syncing files to device Android SDK built for x86... (completed in 344ms)
[   +1 ms] Synced 0.0MB.
[   +1 ms] <- accept
[  +10 ms] Connected to _flutterView/0x95e99c10.
[   +1 ms] Flutter run key commands.
[   +1 ms] r Hot reload. 🔥🔥🔥
[        ] R Hot restart.
[        ] h Repeat this help message.
[        ] d Detach (terminate "flutter run" but leave application running).
[        ] c Clear the screen
[        ] q Quit (terminate the application on the device).
[        ] An Observatory debugger and profiler on Android SDK built for x86 is available at: http://127.0.0.1:38695/Hos4fuXy4Zs=/
[        ] 
           Flutter DevTools, a Flutter debugger and profiler, on Android SDK built for x86 is available at: http://127.0.0.1:9103?uri=http%3A%2F%2F127.0.0.1%3A38695%2FHos4fuXy4Zs%3D%2F
[        ] Running with unsound null safety
[        ] For more information see https://dart.dev/null-safety/unsound-null-safety
[+1693 ms] E/eglCodecCommon( 2062): glUtilsParamSize: unknow param 0x00008741
[+5245 ms] I/flutter ( 2062): 
[        ] I/flutter ( 2062): oldValue.text:                   123,456
[        ] I/flutter ( 2062): oldValue.text.length:            7
[        ] I/flutter ( 2062): oldValue.selection.start:        6
[        ] I/flutter ( 2062): oldValue.selection.end:          6
[        ] I/flutter ( 2062): oldValue.selection.baseOffset:   6
[        ] I/flutter ( 2062): oldValue.selection.extentOffset: 6
[        ] I/flutter ( 2062): oldValue.selection.isValid:      true
[   +1 ms] I/flutter ( 2062): oldValue.selection.isDirectional:false
[        ] I/flutter ( 2062): oldValue.selection.affinity:     TextAffinity.downstream
[        ] I/flutter ( 2062): oldValue.composing.start:        -1
[   +1 ms] I/flutter ( 2062): oldValue.composing.end:          -1
[        ] I/flutter ( 2062): oldValue.composing.isValid:      false
[        ] I/flutter ( 2062): oldValue.composing.isCollapsed:  true
[        ] I/flutter ( 2062): oldValue.composing.isNormalized: true
[  +41 ms] I/flutter ( 2062): new cursor location: 5
[+16443 ms] I/zygote  ( 2062): Do partial code cache collection, code=30KB, data=24KB
[        ] I/zygote  ( 2062): After code cache collection, code=30KB, data=24KB
[        ] I/zygote  ( 2062): Increasing code cache capacity to 128KB
[+1618 ms] Application finished.
[   +5 ms] executing: /home/user1/Android/platform-tools/adb -s emulator-5554 forward --list
[  +25 ms] Exit code 0 from: /home/user1/Android/platform-tools/adb -s emulator-5554 forward --list
[        ] emulator-5554 tcp:32951 tcp:47832
[   +3 ms] executing: /home/user1/Android/platform-tools/adb -s emulator-5554 forward --remove tcp:32951
```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
user1@computer1:~/git_projects/flutter_sandbox$ flutter analyze
Analyzing user1...
No issues found! (ran in 2.0s)
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
user1@computer1:~/git_projects/flutter_sandbox$  flutter doctor -v
[✓] Flutter (Channel stable, 2.0.5, on Linux, locale en_US.UTF-8)
    • Flutter version 2.0.5 at /home/user1/development/flutter
    • Framework revision adc687823a (11 days ago), 2021-04-16 09:40:20 -0700
    • Engine revision b09f014e96
    • Dart version 2.12.3

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /home/user1/Android
    • Platform android-30, build-tools 29.0.2
    • ANDROID_HOME = /home/user1/Android
    • Java binary at: /opt/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Android Studio
    • Android Studio at /opt/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.55.2)
    • VS Code at /usr/share/code
    • Flutter extension version 3.21.0

[✓] Connected device (2 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86    • Android 8.0.0 (API 26) (emulator)
    • Chrome (web)                       • chrome        • web-javascript • Google Chrome 88.0.4324.182

• No issues found!
```

</details>