Repository: flutter
Issue: SelectionArea Widget with CupertinoPicker child throws `'_debugPreviousLeaders!.isEmpty': is not true.`
Labels: a: text input,f: cupertino,a: error message,has reproducible steps,P2,f: selection,team-design,triaged-design,found in release: 3.16,found in release: 3.18

### Steps to reproduce

1. Setup empty Flutter project
2. Paste provided code sample into main.dart
3. Run and debug on any device
4. Tap/click anywhere on the CupertinoPicker

### Expected results

Tapping and holding down on a Text widget inside a CupertinoPicker that is wrapped by a SelectionArea should let you select the Text in the CupertinoPicker.

### Actual results

Running the application causes an exception to be thrown whenever you tap anywhere within the CupertinoPicker:

```
Exception has occurred.
_AssertionError ('package:flutter/src/rendering/layer.dart': Failed assertion: line 2339 pos 16: '_debugPreviousLeaders!.isEmpty': is not true.)
```

Please note:
This does cause the debug session to break, requiring a reload.
This does not seem to cause any actual crashes when running the app outside the debug session.

### 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});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: SelectionArea(
          child: CupertinoPicker(
            itemExtent: 50,
            onSelectedItemChanged: (_) {},
            children: const [
              Text("Element 1"),
              Text("Element 2"),
            ],
          ),
        ),
      ),
    );
  }
}
```

</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.16.5, on macOS 14.2.1 23C71
    darwin-arm64, locale en-AT)
    • Flutter version 3.16.5 on channel stable at
      /opt/homebrew/Caskroom/flutter/3.7.3/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 78666c8dc5 (35 hours ago), 2023-12-19
      16:14:14 -0800
    • Engine revision 3f3e560236
    • Dart version 3.2.3
    • DevTools version 2.28.4

[✓] Android toolchain - develop for Android devices (Android SDK
    version 33.0.2)
    • Android SDK at /Users/igor/Library/Android/sdk
    • Platform android-33, build-tools 33.0.2
    • Java binary at: /Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      11.0.15+0-b2043.56-8887301)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15C65
    • CocoaPods version 1.14.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google
      Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
    • 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.15+0-b2043.56-8887301)

[✓] VS Code (version 1.85.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.78.0

[✓] Connected device (4 available)
    • Android SDK built for arm64 (mobile) • emulator-5554
      • android-arm64  • Android 9 (API 28) (emulator)
    • iPhone SE (3rd generation) (mobile)  •
      2E4B19B6-8685-42A5-9EEE-5B552D84BC2D • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-17-2 (simulator)
    • macOS (desktop)                      • macos
      • darwin-arm64   • macOS 14.2.1 23C71 darwin-arm64
    • Chrome (web)                         • chrome
      • web-javascript • Google Chrome 120.0.6099.129

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>