Repository: flutter
Issue: Empty TextSpan breaks WidgetSpan gestures
Labels: framework,f: gestures,has reproducible steps,P2,team-framework,triaged-framework,found in release: 3.13,found in release: 3.14

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Steps to reproduce

1. Run the sample code
2. Attempt to click the left half of the purple container
3. Observe that the counter does not increment

### Expected results

WidgetSpans following a TextSpan containing an empty string recognize gestures accross their entire surface.

### Actual results

WidgetSpans following a TextSpan containing an empty string recognize gestures only on the right side of their surface.

### Code sample

<details><summary>Code sample</summary>


```dart
import 'package:flutter/material.dart';

void main() => runApp(const App());

class App extends StatelessWidget {
  const App({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(
          brightness: Brightness.dark,
          seedColor: Colors.deepPurple,
        ),
        useMaterial3: true,
      ),
      home: const Home(),
    );
  }
}

class Home extends StatefulWidget {
  const Home({super.key});

  @override
  State<Home> createState() => _HomeState();
}

class _HomeState extends State<Home> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("broken spans"),
      ),
      body: Center(
        child: Text.rich(
          TextSpan(
            children: [
              const TextSpan(
                text:
                    "The following WidgetSpan does not recognize Gestures on the left side:\n",
              ),
              // This empty TextSpan breaks the WidgetSpan.
              // If we add any content, even a space, it works.
              const TextSpan(text: ''),
              WidgetSpan(
                child: InkWell(
                  onTap: _incrementCounter,
                  child: Container(
                    color: Colors.deepPurple,
                    height: 50,
                    width: 50,
                  ),
                ),
              ),
              TextSpan(
                text: "\nCounter: $_counter",
              ),
            ],
          ),
        ),
      ),
    );
  }
}
```

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

https://github.com/flutter/flutter/assets/11785085/928cb9ad-9de6-4294-9780-e74c1329a504


</details>

### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[√] Flutter (Channel stable, 3.13.0, on Microsoft Windows [Version 10.0.22621.2134], locale de-CH)
    • Flutter version 3.13.0 on channel stable at C:\Users\dragon\AppData\Roaming\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision efbf63d9c6 (8 days ago), 2023-08-15 21:05:06 -0500
    • Engine revision 1ac611c64e
    • Dart version 3.1.0
    • DevTools version 2.25.0

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at C:\Users\dragon\AppData\Local\Android\sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.6.2)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.6.33723.286
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2022.3)
    • 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 17.0.6+0-b2043.56-10027231)

[√] VS Code (version 1.81.1)
    • VS Code at C:\Users\dragon\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.70.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22621.2134]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 116.0.5845.97
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 115.0.1901.203

[√] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>