Repository: flutter
Issue: App Background Image Resizes with toggled keyboard in screen pushed above `CupertinoTabScaffold` 
Labels: a: text input,framework,f: cupertino,has reproducible steps,P2,team-design,triaged-design,found in release: 3.19,found in release: 3.22

### Steps to reproduce

1. Place any sample background image within `assets/imgs/bg.png` in a flutter dummy project.
2. Run the provided Code Sample in a simulator (e.g. iPhone 15).
3. Switch among the tabs by clicking on them and tap into the text field -> Keyboard shows up, Background img stays fixed in the bg.
4. On any tab screen, tap on the button `Push To Upper Screen (Normal Push)`. 
5. Tap into the text field in the pushed screen, and you'll see that the background img resizes.
6. Leave that screen and tap the button `Push To Upper Screen (Rootnav Push)`. 
7. Tap into the text field in the pushed screen, and you'll see that the background img DOES NOT resize.

### Expected results

I actually expected the outcome of 5. to be the same as 7. (but with the bottom navigation bar displayed below). I'm unsure if this is actually a bug, as it makes it impossible to use a non-resizing background image in your app as soon as your app uses pushed screens, together with a `CupertinoTabScaffold`?

PS: I'd really prefer to not use `resizeToAvoidBottomInset: false` for obvious UX reasons.

### Actual results

See above.

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Demo',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    /// to be able to use TextFormField within Cupertino
    return ContainerWithBG(
      child: CupertinoTabScaffold(
        backgroundColor: Colors.transparent,
        tabBar: CupertinoTabBar(items: const [
          BottomNavigationBarItem(
            icon: Icon(
              Icons.abc,
            ),
          ),
          BottomNavigationBarItem(
            icon: Icon(
              Icons.adb,
            ),
          ),
        ]),
        tabBuilder: (context, index) {
          return CupertinoTabView(
            builder: (context) {
              return CupertinoPageScaffold(
                backgroundColor: Colors.transparent,
                navigationBar: CupertinoNavigationBar(
                  middle: Text(
                      'Base Tab $index - Img not moving when keyboard toggled'),
                ),
                child: Center(
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: [
                      Text(
                        'Random Content of Tab $index',
                        style: const TextStyle(
                          color: Colors.white,
                          fontSize: 25,
                        ),
                      ),
                      const SizedBox(
                        height: 30,
                      ),
                      const InputField(),
                      const SizedBox(
                        height: 30,
                      ),
                      ElevatedButton(
                        onPressed: () {
                          Navigator.of(context).push(
                            MaterialPageRoute(
                              builder: (context) => const UpperLayer(
                                triggeredViaRootNav: false,
                              ),
                            ),
                          );
                        },
                        child: const Text(
                          'Push To Upper Screen (Normal Push)',
                        ),
                      ),
                      const SizedBox(
                        height: 30,
                      ),
                      ElevatedButton(
                        onPressed: () {
                          Navigator.of(context, rootNavigator: true).push(
                            MaterialPageRoute(
                              builder: (context) => const UpperLayer(
                                triggeredViaRootNav: true,
                              ),
                            ),
                          );
                        },
                        child: const Text(
                          'Push To Upper Screen (Rootnav Push)',
                        ),
                      ),
                    ],
                  ),
                ),
              );
            },
          );
        },
      ),
    );
  }
}

/// Text Field
class InputField extends StatelessWidget {
  const InputField({super.key});

  @override
  Widget build(BuildContext context) {
    /// Material() wrapper to be able to use TextFormField() within Cupertino
    return Material(
      color: Colors.transparent,
      child: Container(
        color: Colors.white,
        margin: const EdgeInsets.all(25.0),
        child: TextFormField(),
      ),
    );
  }
}

/// BG IMG Decoration
class ContainerWithBG extends StatelessWidget {
  final Widget child;

  const ContainerWithBG({
    super.key,
    required this.child,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: const BoxDecoration(
        image: DecorationImage(
          image: AssetImage("assets/imgs/bg.png"),
          fit: BoxFit.cover,
        ),
      ),
      child: child,
    );
  }
}

class UpperLayer extends StatelessWidget {
  /// Just for app bar naming for better understanding
  final bool triggeredViaRootNav;

  const UpperLayer({
    super.key,
    required this.triggeredViaRootNav,
  });

  @override
  Widget build(BuildContext context) {
    return ContainerWithBG(
      child: CupertinoPageScaffold(
        backgroundColor: Colors.transparent,
        navigationBar: CupertinoNavigationBar(
          middle: Text(
            (triggeredViaRootNav
                ? 'Pushed Screen - Img NOT Moving when keyboard toggled (RootNav Push)'
                : 'Pushed Screen - Img Moving when keyboard toggled (Normal Push)'),
          ),
        ),
        child: const Center(
          child: InputField(),
        ),
      ),
    );
  }
}

```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details open><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.19.3, on macOS 14.4 23E214 darwin-arm64, locale de-CH)
    • Flutter version 3.19.3 on channel stable at /Users/ik/dev/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ba39319843 (3 weeks ago), 2024-03-07 15:22:21 -0600
    • Engine revision 2e4ba9c6fb
    • Dart version 3.3.1
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/ik/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.14.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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 17.0.6+0-17.0.6b829.9-10027231)

[✓] IntelliJ IDEA Ultimate Edition (version 2023.3.6)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 78.4.2
    • Dart plugin version 233.14888

[✓] Connected device (3 available)
    • iPhone 15 (mobile) • A79255C5-A054-4C5F-924E-9A0686DC3F35 • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-17-4 (simulator)
    • macOS (desktop)    • macos                                • darwin-arm64   • macOS 14.4 23E214 darwin-arm64
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 123.0.6312.87

[✓] Network resources
    • All expected network resources are available.

• No issues found!

```

</details>