Repository: flutter
Issue: FormField widgets inside ListView bypass form validation and loss of text when the widgets are out of visibility.
Labels: a: text input,c: new feature,framework,f: material design,f: scrolling,has reproducible steps,P3,found in release: 3.3,found in release: 3.7,team-framework,triaged-framework

## Problem Description
I was making a form for inputting user information. As there were multiple fields, some fields went out of screen visibility and when I am submitting the form these fields are not validated.

When I am using FormField widgets inside ListView :
1. If all fields are visible then they all were validated.
2. If some fields are not visible and are out of focus then they were not validated.
3. If some fields are not visible but anyone of the field is in focus then that widget is only validated while the other which are not visible are not validated.
4. If filling any formfield and scrolling it out of view and focusing on any another field then the text is lost of previous field.

When I am using FormField widgets inside SingleChildScrollView
1. All FormFields are validated, it doesn't matter if they are visible or not.
2. No text is lost on scrolling and focussing on another field, which was earlier.

But the common issue is that the field is not focussed on error after validation in both the cases. It doesn't if I use ListView or SingleChildScrollView. 

## Minimum working code

<details><summary>Code</summary>

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Bug(),
    );
  }
}

class Bug extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      body: ListView(
        children: <Widget>[
          RaisedButton(
            child: Text('Listview without bug'),
            onPressed: () {
              Navigator.push(context, MaterialPageRoute(builder: (_) => FormWithListView(fillSpace: false)));
            },
          ),
          RaisedButton(
            child: Text('Listview with bug'),
            onPressed: () {
              Navigator.push(context, MaterialPageRoute(builder: (_) => FormWithListView()));
            },
          ),
          RaisedButton(
            child: Text('SingleChildScrollView without bug'),
            onPressed: () {
              Navigator.push(
                  context, MaterialPageRoute(builder: (_) => FormWithSingleChildScrollView(fillSpace: false)));
            },
          ),
          RaisedButton(
            child: Text('SingleChildScrollView with bug'),
            onPressed: () {
              Navigator.push(context, MaterialPageRoute(builder: (_) => FormWithSingleChildScrollView()));
            },
          ),
        ],
      ),
    );
  }
}

class FormWithListView extends StatefulWidget {
  final bool fillSpace;

  const FormWithListView({Key key, this.fillSpace = true}) : super(key: key);

  @override
  FormWithListViewState createState() {
    return FormWithListViewState();
  }
}

class FormWithListViewState extends State<FormWithListView> {
  final _formKey = GlobalKey<FormState>();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("${widget.fillSpace ? "Buggy" : "Working"} ListView"),
      ),
      body: Container(
        child: Form(
          key: _formKey,
          child: ListView(
            children: <Widget>[
              TextFormField(
                decoration: InputDecoration(hintText: "enter here"),
                validator: (value) {
                  if (value.isEmpty) {
                    return 'Please enter some text';
                  }
                  return null;
                },
              ),
              if (widget.fillSpace)
                Placeholder(
                  fallbackHeight: 1.5 * MediaQuery.of(context).size.height,
                ),
              TextFormField(
                decoration: InputDecoration(hintText: "enter here"),
                validator: (value) {
                  if (value.isEmpty) {
                    return 'Please enter some text';
                  }
                  return null;
                },
              ),
              Builder(
                builder: (context) {
                  return RaisedButton(
                    onPressed: () {
                      if (_formKey.currentState.validate()) {
                        Scaffold.of(context).showSnackBar(SnackBar(content: Text('Form validated')));
                      }
                    },
                    child: Text('Submit'),
                  );
                },
              ),
            ],
          ),
        ),
      ),
    );
  }
}

class FormWithSingleChildScrollView extends StatefulWidget {
  final bool fillSpace;

  const FormWithSingleChildScrollView({Key key, this.fillSpace = true}) : super(key: key);

  @override
  FormWithSingleChildScrollViewState createState() {
    return FormWithSingleChildScrollViewState();
  }
}

class FormWithSingleChildScrollViewState extends State<FormWithSingleChildScrollView> {
  final _formKey = GlobalKey<FormState>();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("${widget.fillSpace ? "Buggy" : "Working"} SingleChildScrollView"),
      ),
      body: Container(
        child: Form(
          key: _formKey,
          child: SingleChildScrollView(
            child: Column(
              children: <Widget>[
                TextFormField(
                  decoration: InputDecoration(hintText: "enter here"),
                  validator: (value) {
                    if (value.isEmpty) {
                      return 'Please enter some text';
                    }
                    return null;
                  },
                ),
                if (widget.fillSpace)
                  Placeholder(
                    fallbackHeight: 1.2 * MediaQuery.of(context).size.height,
                  ),
                TextFormField(
                  decoration: InputDecoration(hintText: "enter here"),
                  validator: (value) {
                    if (value.isEmpty) {
                      return 'Please enter some text';
                    }
                    return null;
                  },
                ),
                Builder(
                  builder: (context) {
                    return RaisedButton(
                      onPressed: () {
                        if (_formKey.currentState.validate()) {
                          Scaffold.of(context).showSnackBar(SnackBar(content: Text('Form validated')));
                        }
                      },
                      child: Text('Submit'),
                    );
                  },
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
```
</details>

## Steps to reproduce error
1. Copy the above code and paste it into a new file.
1. Run the above code.
1. You will see 4 raised buttons on homepage
    1.  ListView without bug
    1.  ListView with bug
    1.  SingleChildScrollView without bug
    1.  SingleChildScrollView with bug
1. If you click first raised button, you will find two text fields and a submit button. This is the first case and it is working fine.
1. If you click second raised button, you will find two text fields separated by a placeholder and a submit button.
    1. To see second error, scroll down and fill the last text field before the submit button and then submit the form, you will see that the form is validated which is wrong.
    1. To see third error, fill the first formfield only and submit the form, it will be validated.
    1. To see fourth error, fill the first formfield and then fill the second formfield the first text will be discarded on focus lost.
1. To see fifth the problem, click the last raised button, you will find two text fields separated by a placeholder and a submit button.
     1. While submitting the form, the formfield with wrong input is being validated but doesn't comes in focus.

<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.
-->

```

[  +64 ms] executing: [/home/shubhgkr/flutterSdk/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +122 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +11 ms] 0b8abb4724aa590dd0f429683339b1e045a1594d
[   +1 ms] executing: [/home/shubhgkr/flutterSdk/flutter/] git describe --match v*.*.* --first-parent --long --tags
[  +23 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[        ] v1.12.13+hotfix.8-0-g0b8abb472
[  +40 ms] executing: [/home/shubhgkr/flutterSdk/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[  +29 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/stable
[        ] executing: [/home/shubhgkr/flutterSdk/flutter/] git ls-remote --get-url origin
[  +21 ms] Exit code 0 from: git ls-remote --get-url origin
[   +1 ms] https://github.com/flutter/flutter.git
[ +177 ms] executing: [/home/shubhgkr/flutterSdk/flutter/] git rev-parse --abbrev-ref HEAD
[  +46 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[ +513 ms] executing: /home/shubhgkr/androidSdk/platform-tools/adb devices -l
[  +24 ms] Exit code 0 from: /home/shubhgkr/androidSdk/platform-tools/adb devices -l
[        ] List of devices attached
           emulator-5554          device product:sdk_phone_x86_64 model:Android_SDK_built_for_x86_64
           device:generic_x86_64 transport_id:1
[  +99 ms] /home/shubhgkr/androidSdk/platform-tools/adb -s emulator-5554 shell getprop
[ +147 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[  +72 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.
[   +5 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[   +2 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.
[ +569 ms] Generating
/home/shubhgkr/IdeaProjects/bug/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
[ +102 ms] ro.hardware = ranchu
[ +162 ms] Using hardware rendering with device Android SDK built for x86 64. If you get graphics artifacts, consider
enabling
                    software rendering with "--enable-software-rendering".
[  +62 ms] Launching lib/main.dart on Android SDK built for x86 64 in debug mode...
[  +53 ms] executing: /home/shubhgkr/androidSdk/platform-tools/adb -s emulator-5554 shell -x logcat -v time -t 1
[  +51 ms] Exit code 0 from: /home/shubhgkr/androidSdk/platform-tools/adb -s emulator-5554 shell -x logcat -v time -t
1
[   +2 ms] --------- beginning of system
           05-01 20:30:15.484 I/UsageStatsService( 1518): User[0] Flushing usage stats to disk
[  +25 ms] executing: /home/shubhgkr/androidSdk/platform-tools/adb version
[   +2 ms] executing: /home/shubhgkr/androidSdk/platform-tools/adb -s emulator-5554 logcat -v time -T 05-01
20:30:15.484
[  +83 ms] Android Debug Bridge version 1.0.41
           Version 29.0.6-6198805
           Installed as /home/shubhgkr/androidSdk/platform-tools/adb
[  +15 ms] executing: /home/shubhgkr/androidSdk/platform-tools/adb start-server
[  +63 ms] Building APK
[  +67 ms] Running Gradle task 'assembleDebug'...
[  +16 ms] gradle.properties already sets `android.enableR8`
[  +33 ms] Using gradle from /home/shubhgkr/IdeaProjects/bug/android/gradlew.
[  +33 ms] executing: /home/shubhgkr/AndroidStudioLinux/jre/bin/java -version
[ +308 ms] Exit code 0 from: /home/shubhgkr/AndroidStudioLinux/jre/bin/java -version
[        ] openjdk version "1.8.0_212-release"
           OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
           OpenJDK 64-Bit Server VM (build 25.212-b4-5784211, mixed mode)
[   +6 ms] executing: /home/shubhgkr/AndroidStudioLinux/jre/bin/java -version
[ +231 ms] Exit code 0 from: /home/shubhgkr/AndroidStudioLinux/jre/bin/java -version
[        ] openjdk version "1.8.0_212-release"
           OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
           OpenJDK 64-Bit Server VM (build 25.212-b4-5784211, mixed mode)
[  +22 ms] executing: [/home/shubhgkr/IdeaProjects/bug/android/] /home/shubhgkr/IdeaProjects/bug/android/gradlew
-Pverbose=true -Ptarget=/home/shubhgkr/IdeaProjects/bug/lib/main.dart -Ptrack-widget-creation=true
-Pfilesystem-scheme=org-dartlang-root -Ptarget-platform=android-x64 assembleDebug
[+4097 ms] Starting a Gradle Daemon, 3 busy and 3 incompatible Daemons could not be reused, use --status for details
[+94422 ms] > Task :app:compileFlutterBuildDebug
[  +12 ms] [  +79 ms] executing: [/home/shubhgkr/flutterSdk/flutter/] git -c log.showSignature=false log -n 1
--pretty=format:%H
[   +1 ms] [  +84 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] [   +2 ms] 0b8abb4724aa590dd0f429683339b1e045a1594d
[        ] [   +2 ms] executing: [/home/shubhgkr/flutterSdk/flutter/] git describe --match v*.*.* --first-parent
--long --tags
[   +8 ms] [  +19 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[        ] [        ] v1.12.13+hotfix.8-0-g0b8abb472
[        ] [  +23 ms] executing: [/home/shubhgkr/flutterSdk/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[   +3 ms] [  +23 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] [        ] origin/stable
[        ] [        ] executing: [/home/shubhgkr/flutterSdk/flutter/] git ls-remote --get-url origin
[        ] [  +23 ms] Exit code 0 from: git ls-remote --get-url origin
[   +5 ms] [        ] https://github.com/flutter/flutter.git
[        ] [ +193 ms] executing: [/home/shubhgkr/flutterSdk/flutter/] git rev-parse --abbrev-ref HEAD
[        ] [  +56 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] [        ] stable
[        ] [ +107 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] [   +1 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +4 ms] [  +16 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.
[   +1 ms] [   +1 ms] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[   +4 ms] [   +3 ms] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] [   +1 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +539 ms] [ +642 ms] Initializing file store
[  +99 ms] [  +68 ms] kernel_snapshot: Starting due to {}
[ +100 ms] [  +50 ms] /home/shubhgkr/flutterSdk/flutter/bin/cache/dart-sdk/bin/dart
/home/shubhgkr/flutterSdk/flutter/bin/cache/artifacts/engine/linux-x64/frontend_server.dart.snapshot --sdk-root
/home/shubhgkr/flutterSdk/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk/ --target=flutter
-Ddart.developer.causal_async_stacks=true -Ddart.vm.profile=false -Ddart.vm.product=false
--bytecode-options=source-positions,local-var-info,debugger-stops,instance-field-initializers,keep-unreachable-code,av
oid-closure-call-instructions --enable-asserts --track-widget-creation --no-link-platform --packages
/home/shubhgkr/IdeaProjects/bug/.packages --output-dill
/home/shubhgkr/IdeaProjects/bug/.dart_tool/flutter_build/02f055ed5fa422255eb2ff43ffb93e94/app.dill --depfile
/home/shubhgkr/IdeaProjects/bug/.dart_tool/flutter_build/02f055ed5fa422255eb2ff43ffb93e94/kernel_snapshot.d
package:bug/main.dart
[+24299 ms] [+24289 ms] kernel_snapshot: Complete
[+5000 ms] [+5021 ms] debug_android_application: Starting due to {}
[+1499 ms] [+1575 ms] debug_android_application: Complete
[ +799 ms] [ +751 ms] Persisting file store
[        ] [  +25 ms] Done persisting file store
[        ] [  +17 ms] build succeeded.
[  +98 ms] [  +31 ms] "flutter assemble" took 32,658ms.
[+1399 ms] > Task :app:packLibsflutterBuildDebug
[        ] > Task :app:preBuild UP-TO-DATE
[        ] > Task :app:preDebugBuild UP-TO-DATE
[  +99 ms] > Task :app:compileDebugAidl NO-SOURCE
[ +800 ms] > Task :app:checkDebugManifest
[ +200 ms] > Task :app:generateDebugBuildConfig
[   +1 ms] > Task :app:compileDebugRenderscript NO-SOURCE
[ +998 ms] > Task :app:cleanMergeDebugAssets UP-TO-DATE
[ +699 ms] > Task :app:mergeDebugShaders
[ +202 ms] > Task :app:compileDebugShaders
[   +1 ms] > Task :app:generateDebugAssets
[  +96 ms] > Task :app:mergeDebugAssets
[ +600 ms] > Task :app:copyFlutterAssetsDebug
[ +101 ms] > Task :app:mainApkListPersistenceDebug
[ +202 ms] > Task :app:generateDebugResValues
[   +1 ms] > Task :app:generateDebugResources
[+6593 ms] > Task :app:mergeDebugResources
[ +300 ms] > Task :app:createDebugCompatibleScreenManifests
[+1499 ms] > Task :app:processDebugManifest
[+1800 ms] > Task :app:processDebugResources
[+30001 ms] > Task :app:compileDebugKotlin
[+10298 ms] > Task :app:javaPreCompileDebug
[+5600 ms] > Task :app:compileDebugJavaWithJavac
[        ] > Task :app:compileDebugSources
[ +298 ms] > Task :app:processDebugJavaRes NO-SOURCE
[ +599 ms] > Task :app:checkDebugDuplicateClasses
[+4999 ms] > Task :app:mergeDebugJavaResource
[+12500 ms] > Task :app:desugarDebugFileDependencies
[+2100 ms] > Task :app:transformClassesWithDexBuilderForDebug
[        ] > Task :app:validateSigningDebug
[ +198 ms] > Task :app:signingConfigWriterDebug
[ +399 ms] > Task :app:mergeDebugJniLibFolders
[+5000 ms] > Task :app:mergeDebugNativeLibs
[+2000 ms] > Task :app:stripDebugDebugSymbols
[   +1 ms] Compatible side by side NDK version was not found.
[   +1 ms] Unable to strip library
'/home/shubhgkr/IdeaProjects/bug/build/app/intermediates/merged_native_libs/debug/out/lib/x86_64/libflutter.so' due to
missing strip tool for ABI 'X86_64'. Packaging it as is.
[   +1 ms] Unable to strip library
'/home/shubhgkr/IdeaProjects/bug/build/app/intermediates/merged_native_libs/debug/out/lib/x86/libflutter.so' due to
missing strip tool for ABI 'X86'. Packaging it as is.
[ +396 ms] > Task :app:mergeExtDexDebug
[+1797 ms] > Task :app:mergeDexDebug
^C(base) shubhgkr@hp:~/IdeaProjects/bug$ flutter run --verbose
[  +86 ms] executing: [/home/shubhgkr/flutterSdk/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +511 ms] executing: /home/shubhgkr/androidSdk/platform-tools/adb devices -l
[  +22 ms] Exit code 0 from: /home/shubhgkr/androidSdk/platform-tools/adb devices -l
[        ] List of devices attached
           emulator-5554          device product:sdk_google_phone_x86 model:Android_SDK_built_for_x86
           device:generic_x86 transport_id:3
[  +95 ms] /home/shubhgkr/androidSdk/platform-tools/adb -s emulator-5554 shell getprop
[ +139 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[  +66 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.
[  +21 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.
[+2287 ms] Generating
/home/shubhgkr/IdeaProjects/bug/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
[ +102 ms] ro.hardware = ranchu
[ +149 ms] Using hardware rendering with device Android SDK built for x86. If you get graphics artifacts, consider
enabling
                    software rendering with "--enable-software-rendering".
[  +90 ms] Launching lib/main.dart on Android SDK built for x86 in debug mode...
[  +57 ms] executing: /home/shubhgkr/androidSdk/build-tools/28.0.3/aapt dump xmltree
/home/shubhgkr/IdeaProjects/bug/build/app/outputs/apk/app.apk AndroidManifest.xml
[ +257 ms] Exit code 0 from: /home/shubhgkr/androidSdk/build-tools/28.0.3/aapt dump xmltree
/home/shubhgkr/IdeaProjects/bug/build/app/outputs/apk/app.apk AndroidManifest.xml
[   +2 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)0x1c
               A: android:compileSdkVersionCodename(0x01010573)="9" (Raw: "9")
               A: package="com.example.bug" (Raw: "com.example.bug")
               A: platformBuildVersionCode=(type 0x10)0x1c
               A: platformBuildVersionName=(type 0x10)0x9
               E: uses-sdk (line=7)
                 A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10
                 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1c
               E: uses-permission (line=14)
                 A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET")
               E: application (line=22)
                 A: android:label(0x01010001)="bug" (Raw: "bug")
                 A: android:icon(0x01010002)=@0x7f080000
                 A: android:name(0x01010003)="io.flutter.app.FlutterApplication" (Raw:
                 "io.flutter.app.FlutterApplication")
                 A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
                 A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw:
                 "androidx.core.app.CoreComponentFactory")
                 E: activity (line=28)
                   A: android:theme(0x01010000)=@0x7f0a0000
                   A: android:name(0x01010003)="com.example.bug.MainActivity" (Raw: "com.example.bug.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: intent-filter (line=35)
                     E: action (line=36)
                       A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
                     E: category (line=38)
                       A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw:
                       "android.intent.category.LAUNCHER")
                 E: meta-data (line=45)
                   A: android:name(0x01010003)="flutterEmbedding" (Raw: "flutterEmbedding")
                   A: android:value(0x01010024)=(type 0x10)0x2
[  +28 ms] executing: /home/shubhgkr/androidSdk/platform-tools/adb -s emulator-5554 shell -x logcat -v time -t 1
[  +49 ms] Exit code 0 from: /home/shubhgkr/androidSdk/platform-tools/adb -s emulator-5554 shell -x logcat -v time -t
1
[   +1 ms] --------- beginning of main
           05-02 04:17:23.148 W/Conscrypt( 2357):       at
           com.google.android.gms.org.conscrypt.ConscryptFileDescriptorSocket.setSoWriteTimeout(:com.google.android.gm
           s@16089013@16.0.89 (020700-239467275):2)
[  +19 ms] executing: /home/shubhgkr/androidSdk/platform-tools/adb version
[   +5 ms] executing: /home/shubhgkr/androidSdk/platform-tools/adb -s emulator-5554 logcat -v time -T 05-02
04:17:23.148
[  +91 ms] Android Debug Bridge version 1.0.41
           Version 29.0.6-6198805
           Installed as /home/shubhgkr/androidSdk/platform-tools/adb
[   +8 ms] executing: /home/shubhgkr/androidSdk/platform-tools/adb start-server
[  +30 ms] Building APK
[  +72 ms] Running Gradle task 'assembleDebug'...
[  +10 ms] gradle.properties already sets `android.enableR8`
[  +10 ms] Using gradle from /home/shubhgkr/IdeaProjects/bug/android/gradlew.
[ +116 ms] executing: /home/shubhgkr/AndroidStudioLinux/jre/bin/java -version
[+1627 ms] Exit code 0 from: /home/shubhgkr/AndroidStudioLinux/jre/bin/java -version
[        ] openjdk version "1.8.0_212-release"
           OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
           OpenJDK 64-Bit Server VM (build 25.212-b4-5784211, mixed mode)
[  +73 ms] executing: /home/shubhgkr/AndroidStudioLinux/jre/bin/java -version
[ +190 ms] Exit code 0 from: /home/shubhgkr/AndroidStudioLinux/jre/bin/java -version
[   +1 ms] openjdk version "1.8.0_212-release"
           OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
           OpenJDK 64-Bit Server VM (build 25.212-b4-5784211, mixed mode)
[  +21 ms] executing: [/home/shubhgkr/IdeaProjects/bug/android/] /home/shubhgkr/IdeaProjects/bug/android/gradlew
-Pverbose=true -Ptarget=/home/shubhgkr/IdeaProjects/bug/lib/main.dart -Ptrack-widget-creation=true
-Pfilesystem-scheme=org-dartlang-root -Ptarget-platform=android-x86 assembleDebug
[+11095 ms] > Task :app:compileFlutterBuildDebug UP-TO-DATE
[        ] > Task :app:packLibsflutterBuildDebug UP-TO-DATE
[        ] > Task :app:preBuild UP-TO-DATE
[        ] > Task :app:preDebugBuild UP-TO-DATE
[        ] > Task :app:compileDebugAidl NO-SOURCE
[  +59 ms] > Task :app:checkDebugManifest UP-TO-DATE
[ +103 ms] > Task :app:generateDebugBuildConfig UP-TO-DATE
[        ] > Task :app:compileDebugRenderscript NO-SOURCE
[ +394 ms] > Task :app:cleanMergeDebugAssets
[ +199 ms] > Task :app:mergeDebugShaders UP-TO-DATE
[        ] > Task :app:compileDebugShaders UP-TO-DATE
[        ] > Task :app:generateDebugAssets UP-TO-DATE
[  +99 ms] > Task :app:mergeDebugAssets
[ +599 ms] > Task :app:copyFlutterAssetsDebug
[        ] > Task :app:mainApkListPersistenceDebug UP-TO-DATE
[  +99 ms] > Task :app:generateDebugResValues UP-TO-DATE
[        ] > Task :app:generateDebugResources UP-TO-DATE
[        ] > Task :app:mergeDebugResources UP-TO-DATE
[ +299 ms] > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
[        ] > Task :app:processDebugManifest UP-TO-DATE
[  +99 ms] > Task :app:processDebugResources UP-TO-DATE
[        ] > Task :app:compileDebugKotlin UP-TO-DATE
[        ] > Task :app:javaPreCompileDebug UP-TO-DATE
[  +99 ms] > Task :app:compileDebugJavaWithJavac UP-TO-DATE
[        ] > Task :app:compileDebugSources UP-TO-DATE
[ +200 ms] > Task :app:processDebugJavaRes NO-SOURCE
[        ] > Task :app:mergeDebugJavaResource UP-TO-DATE
[  +98 ms] > Task :app:checkDebugDuplicateClasses UP-TO-DATE
[ +999 ms] > Task :app:desugarDebugFileDependencies UP-TO-DATE
[        ] > Task :app:mergeExtDexDebug UP-TO-DATE
[   +1 ms] > Task :app:transformClassesWithDexBuilderForDebug UP-TO-DATE
[   +1 ms] > Task :app:mergeDexDebug UP-TO-DATE
[   +4 ms] > Task :app:validateSigningDebug UP-TO-DATE
[  +90 ms] > Task :app:signingConfigWriterDebug UP-TO-DATE
[ +200 ms] > Task :app:mergeDebugJniLibFolders UP-TO-DATE
[        ] > Task :app:mergeDebugNativeLibs UP-TO-DATE
[   +1 ms] > Task :app:stripDebugDebugSymbols UP-TO-DATE
[        ] Compatible side by side NDK version was not found.
[        ] > Task :app:packageDebug UP-TO-DATE
[        ] > Task :app:assembleDebug UP-TO-DATE
[   +1 ms] BUILD SUCCESSFUL in 14s
[        ] 30 actionable tasks: 3 executed, 27 up-to-date
[ +428 ms] Running Gradle task 'assembleDebug'... (completed in 17.2s)
[ +662 ms] calculateSha: LocalDirectory: '/home/shubhgkr/IdeaProjects/bug/build/app/outputs/apk'/app.apk
[ +203 ms] calculateSha: reading file took 202us
[+1231 ms] calculateSha: computing sha took 1224us
[  +14 ms] ✓ Built build/app/outputs/apk/debug/app-debug.apk.
[  +11 ms] executing: /home/shubhgkr/androidSdk/build-tools/28.0.3/aapt dump xmltree
/home/shubhgkr/IdeaProjects/bug/build/app/outputs/apk/app.apk AndroidManifest.xml
[  +36 ms] Exit code 0 from: /home/shubhgkr/androidSdk/build-tools/28.0.3/aapt dump xmltree
/home/shubhgkr/IdeaProjects/bug/build/app/outputs/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)0x1c
               A: android:compileSdkVersionCodename(0x01010573)="9" (Raw: "9")
               A: package="com.example.bug" (Raw: "com.example.bug")
               A: platformBuildVersionCode=(type 0x10)0x1c
               A: platformBuildVersionName=(type 0x10)0x9
               E: uses-sdk (line=7)
                 A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10
                 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1c
               E: uses-permission (line=14)
                 A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET")
               E: application (line=22)
                 A: android:label(0x01010001)="bug" (Raw: "bug")
                 A: android:icon(0x01010002)=@0x7f080000
                 A: android:name(0x01010003)="io.flutter.app.FlutterApplication" (Raw:
                 "io.flutter.app.FlutterApplication")
                 A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
                 A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw:
                 "androidx.core.app.CoreComponentFactory")
                 E: activity (line=28)
                   A: android:theme(0x01010000)=@0x7f0a0000
                   A: android:name(0x01010003)="com.example.bug.MainActivity" (Raw: "com.example.bug.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: intent-filter (line=35)
                     E: action (line=36)
                       A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
                     E: category (line=38)
                       A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw:
                       "android.intent.category.LAUNCHER")
                 E: meta-data (line=45)
                   A: android:name(0x01010003)="flutterEmbedding" (Raw: "flutterEmbedding")
                   A: android:value(0x01010024)=(type 0x10)0x2
[   +5 ms] Stopping app 'app.apk' on Android SDK built for x86.
[   +1 ms] executing: /home/shubhgkr/androidSdk/platform-tools/adb -s emulator-5554 shell am force-stop
com.example.bug
[ +661 ms] executing: /home/shubhgkr/androidSdk/platform-tools/adb -s emulator-5554 shell pm list packages
com.example.bug
[ +374 ms] package:com.example.bug
[   +6 ms] executing: /home/shubhgkr/androidSdk/platform-tools/adb -s emulator-5554 shell cat
/data/local/tmp/sky.com.example.bug.sha1
[  +90 ms] 055785973d019358e5d6f4350ddedc221e98a645
[   +1 ms] Latest build already installed.
[        ] Android SDK built for x86 startApp
[   +9 ms] executing: /home/shubhgkr/androidSdk/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.bug/com.example.bug.MainActivity
[ +525 ms] Starting: Intent { act=android.intent.action.RUN flg=0x20000000 cmp=com.example.bug/.MainActivity (has
extras) }
[   +1 ms] Waiting for observatory port to be available...
[  +13 ms] D/FlutterActivity( 3913): Using the launch theme as normal theme.
[  +19 ms] D/FlutterActivityAndFragmentDelegate( 3913): Setting up FlutterEngine.
[        ] D/FlutterActivityAndFragmentDelegate( 3913): No preferred FlutterEngine was provided. Creating a new
FlutterEngine for this FlutterFragment.
[ +696 ms] D/FlutterActivityAndFragmentDelegate( 3913): Attaching FlutterEngine to the Activity that owns this
Fragment.
[ +178 ms] D/FlutterView( 3913): Attaching to a FlutterEngine: io.flutter.embedding.engine.FlutterEngine@36ab1876
[  +60 ms] D/FlutterActivityAndFragmentDelegate( 3913): Executing Dart entrypoint: main, and sending initial route: /
[ +572 ms] Observatory URL on device: http://127.0.0.1:43089/OnbgzKuYXK8=/
[   +3 ms] executing: /home/shubhgkr/androidSdk/platform-tools/adb -s emulator-5554 forward tcp:0 tcp:43089
[  +60 ms] 42685
[        ] Forwarded host port 42685 to device port 43089 for Observatory
[  +33 ms] Connecting to service protocol: http://127.0.0.1:42685/OnbgzKuYXK8=/
[+1612 ms] Successfully connected to service protocol: http://127.0.0.1:42685/OnbgzKuYXK8=/
[  +13 ms] Sending to VM service: getVM({})
[  +69 ms] Result: {type: VM, name: vm, architectureBits: 32, hostCPU: Android 32-bit virtual processor,
operatingSystem: android, targetCPU: ia32, version: 2.7.0 (Fri Dec 6 16:26:51 2019 +0100) on "android_ia32",
_profilerMode: VM, _nativeZoneMemoryUsage: 0, pid: 3...
[  +16 ms] Sending to VM service: getIsolate({isolateId: isolates/2680530507017179})
[  +10 ms] Sending to VM service: _flutter.listViews({})
[ +215 ms] Result: {type: Isolate, id: isolates/2680530507017179, name: main, number: 2680530507017179, _originNumber:
2680530507017179, startTime: 1588373268925, _heaps: {new: {type: HeapSpace, name: new, vmName: Scavenger, collections:
2, avgCollectionPeriodMillis...
[  +62 ms] Result: {type: FlutterViewList, views: [{type: FlutterView, id: _flutterView/0xb4193190, isolate: {type:
@Isolate, fixedId: true, id: isolates/2680530507017179, name: main.dart$main-2680530507017179, number:
2680530507017179}}]}
[  +33 ms] DevFS: Creating new filesystem on the device (null)
[   +1 ms] Sending to VM service: _createDevFS({fsName: bug})
[ +222 ms] Result: {type: FileSystem, name: bug, uri: file:///data/data/com.example.bug/code_cache/bugRWZJCR/bug/}
[        ] DevFS: Created new filesystem on the device (file:///data/data/com.example.bug/code_cache/bugRWZJCR/bug/)
[   +3 ms] Updating assets
[ +539 ms] Syncing files to device Android SDK built for x86...
[   +8 ms] Scanning asset files
[   +6 ms] <- reset
[   +1 ms] Compiling dart to kernel with 0 updated files
[  +29 ms] /home/shubhgkr/flutterSdk/flutter/bin/cache/dart-sdk/bin/dart
/home/shubhgkr/flutterSdk/flutter/bin/cache/artifacts/engine/linux-x64/frontend_server.dart.snapshot --sdk-root
/home/shubhgkr/flutterSdk/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk/ --incremental
--target=flutter -Ddart.developer.causal_async_stacks=true --output-dill /tmp/flutter_tool.ZUNEWE/app.dill --packages
/home/shubhgkr/IdeaProjects/bug/.packages -Ddart.vm.profile=false -Ddart.vm.product=false
--bytecode-options=source-positions,local-var-info,debugger-stops,instance-field-initializers,keep-unreachable-code,av
oid-closure-call-instructions --enable-asserts --track-widget-creation --filesystem-scheme org-dartlang-root
[  +51 ms] <- compile package:bug/main.dart
[+19379 ms] Updating files
[ +845 ms] DevFS: Sync finished
[ +378 ms] Syncing files to device Android SDK built for x86... (completed in 20,319ms, longer than expected)
[   +2 ms] Synced 0.9MB.
[   +3 ms] Sending to VM service: _flutter.listViews({})
[  +12 ms] Result: {type: FlutterViewList, views: [{type: FlutterView, id: _flutterView/0xb4193190, isolate: {type:
@Isolate, fixedId: true, id: isolates/2680530507017179, name: main.dart$main-2680530507017179, number:
2680530507017179}}]}
[   +1 ms] <- accept
[        ] Connected to _flutterView/0xb4193190.
```

<!--
     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 bug...                                                        

   info • The for, if, and spread elements weren't supported until version 2.3.0, but this code is required to be able to run on earlier versions •
          lib/main.dart:88:15 • sdk_version_ui_as_code
   info • The for, if, and spread elements weren't supported until version 2.3.0, but this code is required to be able to run on earlier versions •
          lib/main.dart:156:17 • sdk_version_ui_as_code

2 issues found. (ran in 7.4s)
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Linux, locale en_US.UTF-8)
    • Flutter version 1.12.13+hotfix.8 at /home/shubhgkr/flutterSdk/flutter
    • Framework revision 0b8abb4724 (3 months ago), 2020-02-11 11:44:36 -0800
    • Engine revision e1e6ced81d
    • Dart version 2.7.0

[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /home/shubhgkr/androidSdk/
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /home/shubhgkr/androidSdk
    • Java binary at: /home/shubhgkr/AndroidStudioLinux/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    ✗ Android license status unknown.
      Try re-installing or updating your Android SDK Manager.
      See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed instructions.

[✓] Android Studio (version 3.6)
    • Android Studio at /home/shubhgkr/AndroidStudioLinux
    • Flutter plugin version 45.0.1
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[!] VS Code (version 1.43.1)
    • VS Code at /usr/share/code
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[!] Connected device
    ! No devices available

! Doctor found issues in 3 categories.
```

</details>