Repository: flutter
Issue: [iPadOS] Stage Manager has incorrect inset when in top corner
Labels: a: text input,platform-ios,engine,P2,team-ios,triaged-ios

## Requirements to Reproduce
* Must be using one of the following devices: 
  * iPad Pro 12.9-inch (3rd generation and later)
  * iPad Pro 11-inch (1st generation and later)
  * iPad Air (5th generation)
* If using a simulator, Xcode version must be at least 14.1 
* Must have Stage Manager enabled (Settings < Home Screen & Multitasking < Stage Manager = On)
* Must be in Portrait orientation

## Steps to Reproduce

<!-- Please include full steps to reproduce so that we can reproduce the problem. -->
1. Execute `flutter run` on the [code sample](https://github.com/flutter/flutter/issues/104689#issuecomment-1139253289).
2. Grab the handle in the bottom right corner and drag inward to make it as small as possible.
3. Click the three dots at the top of the app and select `Add Another Window` and then select a different app
4. Grab the handle in the bottom right corner and drag inward to make other app as small as possible too.
5. Grab three dots at top of the flutter app and drag it up so it's closer to the top of the screen.
6. Click the input field in the flutter app to open the keyboard.

**Expected results:** <!-- what did you want to see? -->

Expect the flutter app would have no inset below the input field (so it should look the same as it did when the keyboard was closed).

**Actual results:** <!-- what did you see? -->

Very small inset below the input field.

![simulator_screenshot_DC237399-6E33-47E8-BC40-0C6329261675](https://user-images.githubusercontent.com/15619084/208488102-2f0f4eee-0f8d-4b60-a1ed-d58494493493.png)

## Notes
For some reason, when it's in this size and position in Stage Manager, the info provided by `UIKeyboardFrameEndUserInfoKey` does not seem accurate.

For example, with an iPad Pro 11 inch:
The screen's dimensions are 834 x 1194.
If the app is full screen, the keyboard's dimensions are 834 x 340. And its origin position is (0, 854). This is as expected. The origin.y is 340 (the keyboard's height) from the bottom of the screen (1194 - 854 = 340).
If the app is top right/left (like screenshot above), the keyboard's dimensions are 834 x 340. However, its origin position is (0, 661). This is not expected. For some reason, the origin.y is wrong for this use case.
If the app is middle or bottom right or left, the keyboard's frame is the same as if it were full screen.

<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.
-->

https://github.com/flutter/flutter/issues/104689#issuecomment-1139253289

</details>

<details>
  <summary>flutter doctor -v</summary>

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[!] Flutter (Channel master, 3.7.0-10.0.pre.50, on macOS 12.6.1 21G217 darwin-arm64, locale en)
    • Flutter version 3.7.0-10.0.pre.50 on channel master at xxx
    ! Upstream repository git@github.com:vashworth/flutter.git is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to git@github.com:vashworth/flutter.git to dismiss this error.
    • Framework revision 32da25053d (67 minutes ago), 2022-12-19 12:16:28 -0500
    • Engine revision a12dadfda6
    • Dart version 3.0.0 (build 3.0.0-35.0.dev)
    • DevTools version 2.20.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to
      perform update checks and upgrades.

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at xxx
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14B47b
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.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 11.0.13+0-b1751.21-8125866)

[✓] VS Code (version 1.74.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.54.0

[✓] Connected device (4 available)
    xxx

[✓] HTTP Host Availability
    • All required HTTP hosts are available
```

</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.
-->