Repository: flutter
Issue: WidgetSpans in RTL text laying out LTR if they occur on the same line
Labels: framework,a: internationalization,a: quality,a: typography,has reproducible steps,P2,found in release: 3.7,found in release: 3.10,team-framework,triaged-framework

## Steps to Reproduce

<!-- You must include full steps to reproduce so that we can reproduce the problem. -->

Run the following app:

```
import 'package:flutter/material.dart';

void main() => runApp(App());

class App extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Widget Test',
      home: TestWidgetSpans(),
    );
  }
}

class TestWidgetSpans extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Directionality(
      textDirection: TextDirection.rtl,
      child: Scaffold(
        body: Center(
          child: Text.rich(
            TextSpan(
              text: 'هذا اختبار',
              style: TextStyle(
                backgroundColor: Colors.grey.withOpacity(0.5),
                fontSize: 30,
              ),
              children: [
                WidgetSpan(
                  child: Container(
                    width: 30.0,
                    color: Colors.blue.withOpacity(0.5),
                    child: Center(
                      child: Text('1'),
                    ),
                  ),
                ),
                TextSpan(text: ' و '),
                WidgetSpan(
                  child: Container(
                    width: 50.0,
                    color: Colors.red.withOpacity(0.5),
                    child: Center(
                      child: Text('2'),
                    ),
                  ),
                ),
                TextSpan(text: ' ثم '),
                WidgetSpan(
                  child: Container(
                    width: 70.0,
                    color: Colors.green.withOpacity(0.5),
                    child: Center(
                      child: Text('3'),
                    ),
                  ),
                ),
                TextSpan(text: ' ، لكنه معطل'),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
```

**Expected results:** <!-- what did you want to see? -->
The `1`, `2`, and `3` widgets laid out RTL.

**Actual results:** <!-- what did you see? -->
![Screenshot_1586469450](https://user-images.githubusercontent.com/8728868/78944967-6f4be680-7a7c-11ea-9850-2393535909ee.png)

<details>
  <summary>Logs</summary>

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[√] Flutter (Channel stable, v1.12.13+hotfix.9, on Microsoft Windows [Version 10.0.18362.720], locale en-US)
    • Flutter version 1.12.13+hotfix.9 at C:\src\flutter
    • Framework revision f139b11009 (10 days ago), 2020-03-30 13:57:30 -0700
    • Engine revision af51afceb8
    • Dart version 2.7.2


[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at C:\Users\mimbr\AppData\Local\Android\Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = C:\Users\mimbr\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
    • All Android licenses accepted.

[√] Android Studio (version 3.5)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 44.0.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] VS Code (version 1.44.0)
    • VS Code at C:\Users\mimbr\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.9.1

[√] Connected device (1 available)
    • sdk gphone x86 • emulator-5554 • android-x86 • Android R (API 29) (emulator)

• No issues found!
```

</details>