Repository: flutter
Issue: Cupertino Text Selection Toolbar has wrong position
Labels: platform-ios,framework,f: cupertino,has reproducible steps,P2,team-design,triaged-design,found in release: 3.24,found in release: 3.25

### Steps to reproduce

1. Clone this repository: https://github.com/ricardoboss/cupertino_selection_bug
2. Run the app ~~on a physical iOS device (cannot reproduce in Simulator)~~
3. Enter some text in the search bar
4. Hold the text until the magnifier appears
5. Let go of the text (the toolbar should appear at the bottom of the search field)

### Expected results

The toolbar should have its arrow at the top, not at the bottom and it should be positioned a bit lower.

### Actual results

The toolbar touches the edge of the text field and the arrow is on the wrong side.

### Code sample

<details open><summary>Code sample</summary>

```dart
class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return const CupertinoPageScaffold(
      navigationBar: CupertinoNavigationBar(
        middle: Text('Cupertino App'),
      ),
      child: SafeArea(
        child: Padding(
          padding: EdgeInsets.all(8.0),
          child: Column(
            children: [
              CupertinoSearchTextField(),
              Expanded(
                child: Center(
                  child: Text('Cupertino Text Selection Toolbar Bug'),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

https://github.com/user-attachments/assets/37cbfb56-e3c5-4842-9044-5c0bade59258

</details>


### Logs

No relevant logs.

### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.24.2, on macOS 14.6.1 23G93 darwin-arm64, locale en-DE)
    • Flutter version 3.24.2 on channel stable at /Users/ricardo/repos/flutter/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4cf269e36d (5 days ago), 2024-09-03 14:30:00 -0700
    • Engine revision a6bd3f1de1
    • Dart version 3.5.2
    • DevTools version 2.37.2

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /Users/ricardo/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: /Users/ricardo/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode-15.4.0.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.1)
    • Android Studio at /Users/ricardo/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.11+0-17.0.11b1207.24-11852314)

[✓] VS Code (version 1.79.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (4 available)
    • iPad Pro 12,9“ 6th Gen (RBO) (mobile) • 00008112-0010094E0181A01E • ios            • iOS 18.0 22A5350a
    • macOS (desktop)                       • macos                     • darwin-arm64   • macOS 14.6.1 23G93 darwin-arm64
    • Mac Designed for iPad (desktop)       • mac-designed-for-ipad     • darwin         • macOS 14.6.1 23G93 darwin-arm64
    • Chrome (web)                          • chrome                    • web-javascript • Google Chrome 128.0.6613.120

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>