Repository: flutter
Issue: Hero animation on text field dismiss keyboard
Labels: a: text input,platform-android,framework,a: animation,f: material design,a: desktop,has reproducible steps,P2,found in release: 3.0,found in release: 3.1,team-design,triaged-design

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Steps to Reproduce

<!-- Please include full steps to reproduce so that we can reproduce the problem. -->

1. Execute `flutter run` on the code sample <!-- (see "Code sample" section below) -->
2. Click on the text field on the home screen. <!-- describe steps to demonstrate bug -->
3. See keyboard up and down and up again on the second screen<!-- for example "Tap on X and see a crash" -->

**Expected results:** <!-- what did you want to see? -->
The keyboard persists after hero animation is finished without jumping up and down. 

**Actual results:** <!-- what did you see? -->
The keyboard dismissed once but because of autofocus its up again. Some times the keyboard was dismissed twice 

<details>
<summary>Code Sample</summary>

<!--
      Please create a minimal reproducible sample that shows the problem
      and attach it below between the lines with the backticks.

      To create it you can use `flutter create bug` command and update the `main.dart` file.

      Alternatively, you can use https://dartpad.dev/
      which is capable of creating and running small Flutter apps.

      Without this we will unlikely be able to progress on the issue, and because of that
      we regretfully will have to close it.
-->
```import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      routes: {
        // When navigating to the "/" route, build the FirstScreen widget.
        'home': (context) => const MyHomePage(),
        'search': (context) => const Search(),
      },
      home:  const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  
  const MyHomePage({Key? key}) : super(key: key);
  
  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {

  @override
  Widget build(BuildContext context) {

    Size size = MediaQuery.of(context).size;

    return Scaffold(
        backgroundColor: Colors.white,
        appBar: AppBar(
          title: const Text('Home',style: TextStyle(color: Colors.white),),
          flexibleSpace: Container(),
          actions: [IconButton(icon: const Icon(Icons.favorite_border,),onPressed: (){})],
          bottom: PreferredSize(
            preferredSize: Size.fromHeight(size.height * 0.07),
            child:  Padding(
              padding: const EdgeInsets.only(left:10.0,right: 10.0, bottom:10.0),
              child: SizedBox(
                height:size.height * 0.06,
                child: Hero(
                  tag:'searchBar',
                  child: Material(
                    type: MaterialType.transparency,
                    child: SizedBox(
                      child: TextField(
                        onTap: ()=>Navigator.pushNamed(context,'search'),
                        readOnly: true,
                        autofocus:false,
                        decoration: InputDecoration(
                          prefixIcon: const Icon(Icons.search, size: 25.0,),
                          border: OutlineInputBorder(
                            borderRadius: BorderRadius.circular(50.0),
                            borderSide: const BorderSide(
                              width: 0,
                              style: BorderStyle.none,
                            ),
                          ),
                          filled: true,
                          hintStyle: TextStyle(color: Colors.grey[800]),
                          hintText: 'Search a word',
                          fillColor: Colors.white,
                          isDense: true,
                          contentPadding: const EdgeInsets.all(0.0),
                        ),
                      ),
                    ),
                  ),
                ),
              ),
            ),
          ),
        ),
        body: Container()
    );
  }
}

class Search extends StatefulWidget {
  const Search({Key? key}) : super(key: key);

  @override
  State<Search> createState() => _SearchState();
}

class _SearchState extends State<Search> {
  @override
  Widget build(BuildContext context) {

    Size size = MediaQuery.of(context).size;

    return Scaffold(
      appBar: AppBar(
        title: Hero(
          tag:'searchBar',
          child: Material(
            type: MaterialType.transparency,
            child: SizedBox(
              height:size.height * 0.05,
              child: TextField(
                // focusNode: focusNode,
                autofocus: true,
                decoration: InputDecoration(
                  prefixIcon: const Icon(Icons.search, size: 25.0,),
                  border: OutlineInputBorder(
                    borderRadius: BorderRadius.circular(50.0),
                    borderSide: const BorderSide(
                      width: 0,
                      style: BorderStyle.none,
                    ),
                  ),
                  filled: true,
                  hintStyle: TextStyle(color: Colors.grey[800]),
                  hintText: 'Search a word',
                  fillColor: Colors.white,
                  // isDense: true,
                  contentPadding: const EdgeInsets.all(0.0),
                ),
              ),
            ),
          ),
        ),
      ),
      body: Container(),
    );
  }
}

```

</details>

<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. If there is a crash, please include
      the entirety of the crash log including the backtrace.
-->

```
  +83 ms] executing: [C:\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +141 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +1 ms] 676cefaaff197f27424942307668886253e1ec35
[        ] executing: [C:\flutter/] git tag --points-at 676cefaaff197f27424942307668886253e1ec35
[ +231 ms] Exit code 0 from: git tag --points-at 676cefaaff197f27424942307668886253e1ec35
[        ] 3.0.3
[  +11 ms] executing: [C:\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[  +68 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/stable
[        ] executing: [C:\flutter/] git ls-remote --get-url origin
[  +64 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[ +167 ms] executing: [C:\flutter/] git rev-parse --abbrev-ref HEAD
[ +117 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[ +190 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[   +1 ms] 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.
[  +16 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'WindowsUwpEngineArtifacts' 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.
[ +132 ms] executing: C:\Users\EnzoCheng\AppData\Local\Android\sdk\platform-tools\adb.exe devices -l
[  +73 ms] List of devices attached
           emulator-5554          device product:sdk_phone_x86 model:Android_SDK_built_for_x86 device:generic_x86 transport_id:2
[  +12 ms] C:\Users\EnzoCheng\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell getprop
[  +79 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ +357 ms] Downloading Web SDK...
[ +627 ms] Content https://storage.googleapis.com/flutter_infra_release/flutter/ffe7b86a1e5b5cb63c8385ae1adc759e372ee8f4/flutter-web-sdk-windows-x64.zip md5 hash: uJ9Rir7Yv1kWbr840y+ukQ==
[+37728 ms] Downloading Web SDK... (completed in 38.3s)
[+6746 ms] Downloading CanvasKit...
[+1226 ms] Content https://chrome-infra-packages.appspot.com/dl/flutter/web/canvaskit_bundle/+/8MSYGWVWzrTJIoVL00ZquruZs-weuwLBy1kt1AawJiIC md5 hash: aaW7noKw3KtLgNR1YJEqUQ==
[+10585 ms] Downloading CanvasKit... (completed in 11.8s)
[ +641 ms] Downloading windows-x64/windows-x64-flutter tools...
[ +274 ms] Content https://storage.googleapis.com/flutter_infra_release/flutter/ffe7b86a1e5b5cb63c8385ae1adc759e372ee8f4/windows-x64/windows-x64-flutter.zip md5 hash: 7K2UxWJog6ZTvm31QZFGqQ==
[+125307 ms] Downloading windows-x64/windows-x64-flutter tools... (completed in 125.6s)
[+9924 ms] Downloading windows-x64/flutter-cpp-client-wrapper tools...
[ +233 ms] Content https://storage.googleapis.com/flutter_infra_release/flutter/ffe7b86a1e5b5cb63c8385ae1adc759e372ee8f4/windows-x64/flutter-cpp-client-wrapper.zip md5 hash: 50BxhIqmafNSweFVpHx/2g==
[ +165 ms] Downloading windows-x64/flutter-cpp-client-wrapper tools... (completed in 383ms)
[ +141 ms] Downloading windows-x64-profile/windows-x64-flutter tools...
[ +270 ms] Content https://storage.googleapis.com/flutter_infra_release/flutter/ffe7b86a1e5b5cb63c8385ae1adc759e372ee8f4/windows-x64-profile/windows-x64-flutter.zip md5 hash: Mya2JezX+X42wqOTMTLKjg==
[+70758 ms] Downloading windows-x64-profile/windows-x64-flutter tools... (completed in 71.0s)
[+8342 ms] Downloading windows-x64-release/windows-x64-flutter tools...
[ +248 ms] Content https://storage.googleapis.com/flutter_infra_release/flutter/ffe7b86a1e5b5cb63c8385ae1adc759e372ee8f4/windows-x64-release/windows-x64-flutter.zip md5 hash: cbInDkk24vHRD/F1gvOrYw==
[+48562 ms] Downloading windows-x64-release/windows-x64-flutter tools... (completed in 48.8s)
[+7714 ms] Artifact Instance of 'WindowsUwpEngineArtifacts' 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.
[ +353 ms] Skipping pub get: version match.
[ +156 ms] Generating C:\Users\EnzoCheng\StudioProjects\hero\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[  +75 ms] ro.hardware = ranchu
[  +18 ms] Using hardware rendering with device Android SDK built for x86. If you notice graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
[  +35 ms] Initializing file store
[  +15 ms] Skipping target: gen_localizations
[  +10 ms] gen_dart_plugin_registrant: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have updated contents: C:\Users\EnzoCheng\StudioProjects\hero\.dart_tool\package_config_subset}
[  +32 ms] gen_dart_plugin_registrant: Complete
[   +3 ms] Skipping target: _composite
[   +2 ms] complete
[   +5 ms] Launching lib\main.dart on Android SDK built for x86 in debug mode...
[   +4 ms] C:\flutter\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev C:\flutter\bin\cache\dart-sdk\bin\snapshots\frontend_server.dart.snapshot --sdk-root
C:\flutter\bin\cache\artifacts\engine\common\flutter_patched_sdk/ --incremental --target=flutter --debugger-module-names --experimental-emit-debug-metadata -DFLUTTER_WEB_AUTO_DETECT=true --output-dill
C:\Users\ENZOCH~1\AppData\Local\Temp\flutter_tools.c095a0fd\flutter_tool.f1c33699\app.dill --packages C:\Users\EnzoCheng\StudioProjects\hero\.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\c075001b96339384a97db4862b8ab8db.cache.dill.track.dill
--enable-experiment=alternative-invalidation-strategy
[  +20 ms] executing: C:\Users\EnzoCheng\AppData\Local\Android\sdk\build-tools\32.1.0-rc1\aapt dump xmltree C:\Users\EnzoCheng\StudioProjects\hero\build\app\outputs\flutter-apk\app.apk AndroidManifest.xml
[  +93 ms] Exit code 0 from: C:\Users\EnzoCheng\AppData\Local\Android\sdk\build-tools\32.1.0-rc1\aapt dump xmltree C:\Users\EnzoCheng\StudioProjects\hero\build\app\outputs\flutter-apk\app.apk AndroidManifest.xml
[   +1 ms] 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)0x1f
               A: android:compileSdkVersionCodename(0x01010573)="12" (Raw: "12")
               A: package="com.example.hero" (Raw: "com.example.hero")
               A: platformBuildVersionCode=(type 0x10)0x1f
               A: platformBuildVersionName=(type 0x10)0xc
               E: uses-sdk (line=7)
                 A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10
                 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1f
               E: uses-permission (line=15)
                 A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET")
               E: application (line=17)
                 A: android:label(0x01010001)="hero" (Raw: "hero")
                 A: android:icon(0x01010002)=@0x7f080000
                 A: android:name(0x01010003)="android.app.Application" (Raw: "android.app.Application")
                 A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
                 A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw: "androidx.core.app.CoreComponentFactory")
                 E: activity (line=23)
                   A: android:theme(0x01010000)=@0x7f0a0000
                   A: android:name(0x01010003)="com.example.hero.MainActivity" (Raw: "com.example.hero.MainActivity")
                   A: android:exported(0x01010010)=(type 0x12)0xffffffff
                   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=38)
                     A: android:name(0x01010003)="io.flutter.embedding.android.NormalTheme" (Raw: "io.flutter.embedding.android.NormalTheme")
                     A: android:resource(0x01010025)=@0x7f0a0001
                   E: intent-filter (line=42)
                     E: action (line=43)
                       A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
                     E: category (line=45)
                       A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER")
                 E: meta-data (line=52)
                   A: android:name(0x01010003)="flutterEmbedding" (Raw: "flutterEmbedding")
                   A: android:value(0x01010024)=(type 0x10)0x2
                 E: uses-library (line=56)
                   A: android:name(0x01010003)="androidx.window.extensions" (Raw: "androidx.window.extensions")
                   A: android:required(0x0101028e)=(type 0x12)0x0
                 E: uses-library (line=59)
                   A: android:name(0x01010003)="androidx.window.sidecar" (Raw: "androidx.window.sidecar")
                   A: android:required(0x0101028e)=(type 0x12)0x0
[   +7 ms] executing: C:\Users\EnzoCheng\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell -x logcat -v time -t 1
[  +23 ms] <- compile package:hero/main.dart
[ +215 ms] --------- beginning of main
                    06-29 08:35:08.469 E/wifi_forwarder(  488): RemoteConnection failed to initialize: RemoteConnection failed to open pipe
[  +56 ms] executing: C:\Users\EnzoCheng\AppData\Local\Android\sdk\platform-tools\adb.exe version
[ +102 ms] Android Debug Bridge version 1.0.41
                    Version 33.0.2-8557947
                    Installed as C:\Users\EnzoCheng\AppData\Local\Android\sdk\platform-tools\adb.exe
[   +4 ms] executing: C:\Users\EnzoCheng\AppData\Local\Android\sdk\platform-tools\adb.exe start-server
[ +103 ms] Building APK
[  +27 ms] Running Gradle task 'assembleDebug'...
[   +7 ms] Using gradle from C:\Users\EnzoCheng\StudioProjects\hero\android\gradlew.bat.
[  +24 ms] executing: C:\Program Files\Android\Android Studio\jre\bin\java -version
[ +314 ms] Exit code 0 from: C:\Program Files\Android\Android Studio\jre\bin\java -version
[   +1 ms] openjdk version "11.0.12" 2021-07-20
           OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
           OpenJDK 64-Bit Server VM (build 11.0.12+7-b1504.28-7817840, mixed mode)
[   +3 ms] executing: C:\Program Files\Android\Android Studio\jre\bin\java -version
[ +224 ms] Exit code 0 from: C:\Program Files\Android\Android Studio\jre\bin\java -version
[        ] openjdk version "11.0.12" 2021-07-20
           OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
           OpenJDK 64-Bit Server VM (build 11.0.12+7-b1504.28-7817840, mixed mode)
[   +3 ms] executing: [C:\Users\EnzoCheng\StudioProjects\hero\android/] C:\Users\EnzoCheng\StudioProjects\hero\android\gradlew.bat -Pverbose=true -Ptarget-platform=android-x86
-Ptarget=C:\Users\EnzoCheng\StudioProjects\hero\lib\main.dart -Pbase-application-name=android.app.Application -Pdart-defines=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ== -Pdart-obfuscation=false
-Ptrack-widget-creation=true -Ptree-shake-icons=false -Pfilesystem-scheme=org-dartlang-root assembleDebug
[+1916 ms] Welcome to Gradle 7.4!
[   +2 ms] Here are the highlights of this release:
[        ]  - Aggregated test and JaCoCo reports
[        ]  - Marking additional test source directories as tests in IntelliJ
[        ]  - Support for Adoptium JDKs in Java toolchains
[        ] For more details see https://docs.gradle.org/7.4/release-notes.html
[+9496 ms] > Task :app:preBuild UP-TO-DATE
[   +2 ms] > Task :app:preDebugBuild UP-TO-DATE
[   +2 ms] > Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
[+19687 ms] > Task :app:compileFlutterBuildDebug
[  +91 ms] > Task :app:packLibsflutterBuildDebug UP-TO-DATE
[   +1 ms] > Task :app:compileDebugAidl NO-SOURCE
[        ] > Task :app:compileDebugRenderscript NO-SOURCE
[ +107 ms] > Task :app:generateDebugBuildConfig UP-TO-DATE
[ +391 ms] > Task :app:checkDebugAarMetadata UP-TO-DATE
[   +3 ms] > Task :app:cleanMergeDebugAssets
[ +106 ms] > Task :app:mergeDebugShaders UP-TO-DATE
[   +7 ms] > Task :app:compileDebugShaders NO-SOURCE
[  +22 ms] > Task :app:generateDebugAssets UP-TO-DATE
[ +165 ms] > Task :app:mergeDebugAssets
[+1091 ms] > Task :app:copyFlutterAssetsDebug
[ +107 ms] > Task :app:generateDebugResValues UP-TO-DATE
[  +25 ms] > Task :app:generateDebugResources UP-TO-DATE
[+2170 ms] > Task :app:mergeDebugResources UP-TO-DATE
[   +1 ms] > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
[   +1 ms] > Task :app:extractDeepLinksDebug UP-TO-DATE
[  +93 ms] > Task :app:processDebugMainManifest UP-TO-DATE
[   +2 ms] > Task :app:processDebugManifest UP-TO-DATE
[   +1 ms] > Task :app:processDebugManifestForPackage UP-TO-DATE
[ +106 ms] > Task :app:processDebugResources UP-TO-DATE
[ +389 ms] > Task :app:compileDebugKotlin UP-TO-DATE
[   +2 ms] > Task :app:javaPreCompileDebug UP-TO-DATE
[        ] > Task :app:compileDebugJavaWithJavac UP-TO-DATE
[ +298 ms] > Task :app:processDebugJavaRes NO-SOURCE
[ +197 ms] > Task :app:mergeDebugJavaResource UP-TO-DATE
[ +108 ms] > Task :app:checkDebugDuplicateClasses UP-TO-DATE
[ +299 ms] > Task :app:dexBuilderDebug UP-TO-DATE
[   +2 ms] > Task :app:desugarDebugFileDependencies UP-TO-DATE
[   +1 ms] > Task :app:mergeExtDexDebug UP-TO-DATE
[   +1 ms] > Task :app:mergeDexDebug UP-TO-DATE
[  +86 ms] > 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
[        ] > Task :app:writeDebugAppMetadata UP-TO-DATE
[  +10 ms] > Task :app:writeDebugSigningConfigVersions UP-TO-DATE
[ +692 ms] > Task :app:compressDebugAssets
[  +75 ms] Execution optimizations have been disabled for task ':app:compressDebugAssets' to ensure correctness due to the following reasons:
[   +1 ms]   - Gradle detected a problem with the following location: 'C:\Users\EnzoCheng\StudioProjects\hero\build\app\intermediates\assets\debug\mergeDebugAssets'. Reason: Task ':app:compressDebugAssets' uses
this output of task ':app:copyFlutterAssetsDebug' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please
refer to https://docs.gradle.org/7.4/userguide/validation_problems.html#implicit_dependency for more details about this problem.
[+2722 ms] > Task :app:packageDebug
[   +2 ms] > Task :app:createDebugApkListingFileRedirect UP-TO-DATE
[ +592 ms] > Task :app:assembleDebug
[ +109 ms] Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
[   +2 ms] You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
[   +1 ms] See https://docs.gradle.org/7.4/userguide/command_line_interface.html#sec:command_line_warnings
[        ] Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.
[        ] Please consult deprecation warnings for more details.
[        ] BUILD SUCCESSFUL in 40s
[        ] 35 actionable tasks: 7 executed, 28 up-to-date
[ +950 ms] Running Gradle task 'assembleDebug'... (completed in 42.7s)
[ +712 ms] calculateSha: LocalDirectory: 'C:\Users\EnzoCheng\StudioProjects\hero\build\app\outputs\flutter-apk'/app.apk
[+1172 ms] √  Built build\app\outputs\flutter-apk\app-debug.apk.
[   +9 ms] executing: C:\Users\EnzoCheng\AppData\Local\Android\sdk\build-tools\32.1.0-rc1\aapt dump xmltree C:\Users\EnzoCheng\StudioProjects\hero\build\app\outputs\flutter-apk\app.apk AndroidManifest.xml
[  +89 ms] Exit code 0 from: C:\Users\EnzoCheng\AppData\Local\Android\sdk\build-tools\32.1.0-rc1\aapt dump xmltree C:\Users\EnzoCheng\StudioProjects\hero\build\app\outputs\flutter-apk\app.apk AndroidManifest.xml
[   +1 ms] 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)0x1f
               A: android:compileSdkVersionCodename(0x01010573)="12" (Raw: "12")
               A: package="com.example.hero" (Raw: "com.example.hero")
               A: platformBuildVersionCode=(type 0x10)0x1f
               A: platformBuildVersionName=(type 0x10)0xc
               E: uses-sdk (line=7)
                 A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10
                 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1f
               E: uses-permission (line=15)
                 A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET")
               E: application (line=17)
                 A: android:label(0x01010001)="hero" (Raw: "hero")
                 A: android:icon(0x01010002)=@0x7f080000
                 A: android:name(0x01010003)="android.app.Application" (Raw: "android.app.Application")
                 A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
                 A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw: "androidx.core.app.CoreComponentFactory")
                 E: activity (line=23)
                   A: android:theme(0x01010000)=@0x7f0a0000
                   A: android:name(0x01010003)="com.example.hero.MainActivity" (Raw: "com.example.hero.MainActivity")
                   A: android:exported(0x01010010)=(type 0x12)0xffffffff
                   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=38)
                     A: android:name(0x01010003)="io.flutter.embedding.android.NormalTheme" (Raw: "io.flutter.embedding.android.NormalTheme")
                     A: android:resource(0x01010025)=@0x7f0a0001
                   E: intent-filter (line=42)
                     E: action (line=43)
                       A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
                     E: category (line=45)
                       A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER")
                 E: meta-data (line=52)
                   A: android:name(0x01010003)="flutterEmbedding" (Raw: "flutterEmbedding")
                   A: android:value(0x01010024)=(type 0x10)0x2
                 E: uses-library (line=56)
                   A: android:name(0x01010003)="androidx.window.extensions" (Raw: "androidx.window.extensions")
                   A: android:required(0x0101028e)=(type 0x12)0x0
                 E: uses-library (line=59)
                   A: android:name(0x01010003)="androidx.window.sidecar" (Raw: "androidx.window.sidecar")
                   A: android:required(0x0101028e)=(type 0x12)0x0
[   +8 ms] Stopping app 'app.apk' on Android SDK built for x86.
[   +2 ms] executing: C:\Users\EnzoCheng\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell am force-stop com.example.hero
[ +149 ms] executing: C:\Users\EnzoCheng\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell pm list packages com.example.hero
[ +666 ms] package:com.example.hero
[   +2 ms] executing: C:\Users\EnzoCheng\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell cat /data/local/tmp/sky.com.example.hero.sha1
[ +266 ms] 79d757fe8e79dabe4f063e4300617c3b077de93f
[   +3 ms] Installing APK.
[   +3 ms] Installing build\app\outputs\flutter-apk\app.apk...
[        ] executing: C:\Users\EnzoCheng\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 install -t -r C:\Users\EnzoCheng\StudioProjects\hero\build\app\outputs\flutter-apk\app.apk
[+2495 ms] Performing Streamed Install
                    Success
[   +1 ms] Installing build\app\outputs\flutter-apk\app.apk... (completed in 2,496ms)
[   +2 ms] executing: C:\Users\EnzoCheng\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell echo -n 1017310f35b4c9e5dd9aea3245f72d968779c4db > /data/local/tmp/sky.com.example.hero.sha1
[ +149 ms] executing: C:\Users\EnzoCheng\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell -x logcat -v time -t 1
[ +344 ms] --------- beginning of kernel
                    06-29 08:36:10.816 D/logd    (    0): logdr: UID=2000 GID=2000 PID=31709 n tail=1 logMask=99 pid=0 start=0ns timeout=0ns
[  +67 ms] executing: C:\Users\EnzoCheng\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell am start -a android.intent.action.RUN -f 0x20000000 --ez enable-dart-profiling true --ez
enable-checked-mode true --ez verify-entry-points true com.example.hero/com.example.hero.MainActivity
[ +206 ms] Starting: Intent { act=android.intent.action.RUN flg=0x20000000 cmp=com.example.hero/.MainActivity (has extras) }
[   +1 ms] Waiting for observatory port to be available...
[+2880 ms] Observatory URL on device: http://127.0.0.1:40559/ueTVTOt9rBM=/
[  +42 ms] executing: C:\Users\EnzoCheng\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 forward tcp:0 tcp:40559
[ +166 ms] 63325
[   +2 ms] Forwarded host port 63325 to device port 40559 for Observatory
[  +27 ms] Caching compiled dill
[ +327 ms] Connecting to service protocol: http://127.0.0.1:63325/ueTVTOt9rBM=/
[ +628 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:63325/ueTVTOt9rBM=/.
[ +361 ms] DDS is listening at http://127.0.0.1:63332/919LJKS8P74=/.
[ +106 ms] Successfully connected to service protocol: http://127.0.0.1:63325/ueTVTOt9rBM=/
[ +130 ms] DevFS: Creating new filesystem on the device (null)
[  +87 ms] DevFS: Created new filesystem on the device (file:///data/user/0/com.example.hero/code_cache/heroFWJBQK/hero/)
[  +88 ms] Updating assets
[ +250 ms] Syncing files to device Android SDK built for x86...
[  +18 ms] <- reset
[        ] Compiling dart to kernel with 0 updated files
[   +1 ms] Processing bundle.
[   +3 ms] <- recompile package:hero/main.dart 273e4786-4409-4c9f-bea9-ef9c7b905e55
[        ] <- 273e4786-4409-4c9f-bea9-ef9c7b905e55
[   +3 ms] Bundle processing done.
[+1491 ms] Updating files.
[   +1 ms] DevFS: Sync finished
[   +6 ms] Syncing files to device Android SDK built for x86... (completed in 1,522ms)
[   +3 ms] Synced 0.0MB.
[   +5 ms] <- accept
[  +26 ms] Connected to _flutterView/0xf2f80960.
[  +97 ms] Flutter run key commands.
[   +2 ms] r Hot reload. 
[   +1 ms] R Hot restart.
[        ] h List all available interactive commands.
[        ] d Detach (terminate "flutter run" but leave application running).
[        ] c Clear the screen
[   +1 ms] q Quit (terminate the application on the device).
[  +23 ms]  Running with sound null safety 
[   +1 ms] An Observatory debugger and profiler on Android SDK built for x86 is available at: http://127.0.0.1:63332/919LJKS8P74=/
[+1388 ms] The Flutter DevTools debugger and profiler on Android SDK built for x86 is available at: http://127.0.0.1:9101?uri=http://127.0.0.1:63332/919LJKS8P74=/
[+1
```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
Analyzing hero...
No issues found! (ran in 5.7s)

```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[√] Flutter (Channel stable, 3.0.3, on Microsoft Windows [Version 10.0.22000.739], locale en-SG)
    • Flutter version 3.0.3 at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 676cefaaff (7 days ago), 2022-06-22 11:34:49 -0700
    • Engine revision ffe7b86a1e
    • Dart version 2.17.5
    • DevTools version 2.12.2

[!] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at C:\Users\EnzoCheng\AppData\Local\Android\sdk
    X cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[!] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.1)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.1.32228.430
    X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++" workload, and include these components:
        MSVC v142 - VS 2019 C++ x64/x86 build tools
         - If there are multiple build tool versions available, install the latest
        C++ CMake tools for Windows
        Windows 10 SDK

[√] Android Studio (version 2021.2)
    • Android Studio at C:\Program Files\Android\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 11.0.12+7-b1504.28-7817840)

[√] VS Code (version 1.68.1)
    • VS Code at C:\Users\EnzoCheng\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (3 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • Windows (desktop)                  • windows       • windows-x64    • Microsoft Windows [Version 10.0.22000.739]
    • Edge (web)                         • edge          • web-javascript • Microsoft Edge 102.0.1245.33

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 3 categories.

```

</details>


<!--
      Consider also attaching screenshots and/or videos to better
      illustrate the issue.

      You can upload them directly on GitHub.
      Beware that video file size is limited to 10MB.
-->

Look at this GIF: 
![ezgif-2-f114bd3902](https://user-images.githubusercontent.com/42179618/176398961-57976f77-b2ef-472a-b7e5-bcac367199f1.gif)