Repository: flutter
Issue: [add-to-app][Android]: App doesn't rebuild widgets if keyboard is opened on older android versions
Labels: a: text input,platform-android,framework,a: existing-apps,e: OS-version specific,has reproducible steps,P2,found in release: 2.10,found in release: 2.13,team-android,triaged-android

## Description
If you add a flutter fragment to an existing app, the behavior after the keyboard was opened differs between android versions (8/9 vs. 12). While Android 12 rebuilds the widgets when the keyboard is opened, Android 9 doesn't. Behavior clearly observable by watching the `print` statement of the `viewInset.bottom`: Shows different values when keyboard is opening on Android 12, while showing nothing on Android 9.

This leads to the problem, that the lower text fields will not scroll into view on android 9, because they are still hidden behind the keyboard.

Android 8
https://user-images.githubusercontent.com/31889204/159942386-3a97005f-7f3c-4a75-8261-69655498957c.mp4
Android 12
https://user-images.githubusercontent.com/31889204/159942371-767f468f-41a3-4b40-a302-04fbeb105c78.mp4

**Expected results:** 
Opening the keyboard will result in a widget rebuild on any Android version, so that text fields will scroll into view automatically.

**Actual results:** 
Opening keyboard on Android 8 & 9 won't rebuild widgets, so text fields are hidden behind the keyboard.

A minimal working example on [github](https://github.com/DarkMikey/flutter_add_to_app_bottom_padding_issue/tree/main) was created. 
It includes a small flutter fragment + an android example (File > New > New Project > Bottom Navigation Activity).
I followed the instructions provided by the flutter docs

 - [Integrate a Flutter module into your Android project](https://docs.flutter.dev/development/add-to-app/android/project-setup)
 - [Adding a Flutter Fragment to an Android app](https://docs.flutter.dev/development/add-to-app/android/add-flutter-fragment)

_Please ignore the whitespace shown in the videos and in the minimal working example, this is another issue which is tracked in [Flutter add-to-app fragment inserts unnecessary bottom padding when keyboard is open #96520](https://github.com/flutter/flutter/issues/96520)_

<details>
  <summary>Basic example: </summary>

```dart
class MyHomePage extends StatelessWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    print(MediaQuery.of(context).viewInsets.bottom);
    return Scaffold(
      body: SingleChildScrollView(
        child: Column(
          children: [
            _buildTextField(),
            const SizedBox(height: 30),
            _buildTextField(),
            const SizedBox(height: 30),
            _buildTextField(),
            const SizedBox(height: 30),
            _buildTextField(),
            const SizedBox(height: 30),
            _buildTextField(),
            const SizedBox(height: 30),
            _buildTextField(),
            const SizedBox(height: 30),
            _buildTextField(),
            const SizedBox(height: 30),
          ],
        ),
      ),
    );
  }

  Widget _buildTextField() {
    return const TextField(
      decoration: InputDecoration(
        border: OutlineInputBorder(),
        hintText: 'Enter a search term',
      ),
    );
  }
}
```

</details>

<details>
  <summary>flutter doctor -v</summary>

  [√] Flutter (Channel stable, 2.10.3, on Microsoft Windows [Version 10.0.19044.1586], locale en-AT)
    • Flutter version 2.10.3 at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7e9793dee1 (3 weeks ago), 2022-03-02 11:23:12 -0600
    • Engine revision bd539267b4
    • Dart version 2.16.1
    • DevTools version 2.9.2

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)     
    • Android SDK at C:\Users\user\AppData\Local\Android\sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.11.10)    
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
    • Visual Studio Build Tools 2019 version 16.11.32126.315
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.1)
    • 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.11+9-b60-7590822)

[√] VS Code (version 1.65.2)
    • VS Code at C:\Users\user\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.36.0

[√] Connected device (4 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86    • Android 8.0.0 (API 26) (emulator)
    • Windows (desktop)                  • windows       • windows-x64    • Microsoft Windows [Version 10.0.19044.1586]
    • Chrome (web)                       • chrome        • web-javascript • Google Chrome 98.0.4758.81
    • Edge (web)                         • edge          • web-javascript • Microsoft Edge 98.0.1108.62

[√] HTTP Host Availability
    • All required HTTP hosts are available
• No issues found!

</details>