Repository: flutter
Issue: When there is a WidgetSpan in a TextSpan, and the RichText contains both Chinese and English, TextAlign.justify cannot take effect
Labels: framework,a: internationalization,a: typography,has reproducible steps,P2,team-framework,triaged-framework,found in release: 3.24,found in release: 3.25

### Steps to reproduce

run code sample on the Mac

### Expected results

The text should fill the width without leaving any white space

### Actual results

![image](https://github.com/user-attachments/assets/69ca27f0-755f-4077-ab8b-c0aacc381a41)
The green row has white space on the right side

### Code sample

```dart
import 'package:flutter/material.dart';

void main(List<String> args) {
  const style = TextStyle(
    fontFamily: 'PingFang',
    fontSize: 26,
    color: Colors.black,
  );

  runApp(
    MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: Center(
          child: SizedBox(
            width: 376,
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.stretch,
              children: [
                Container(
                  color: Colors.red,
                  child: RichText(
                    text: TextSpan(
                      style: style,
                      children: [
                        TextSpan(text: '为什么'),
                        TextSpan(text: 'flutter text layout is so expensive?'),
                      ],
                    ),
                    textAlign: TextAlign.justify,
                  ),
                ),
                Container(
                  color: Colors.green,
                  child: RichText(
                    text: TextSpan(
                      style: style,
                      children: [
                        TextSpan(text: '为什么'),
                        WidgetSpan(
                          child: Image.network(
                            width: 26,
                            'https://storage.googleapis.com/cms-storage-bucket/a40ceb6e5d342207de7b.png',
                          ),
                        ),
                        TextSpan(text: 'flutter text layout is so expensive?'),
                      ],
                    ),
                    textAlign: TextAlign.justify,
                  ),
                ),
                Container(
                  color: Colors.yellow,
                  child: RichText(
                    text: TextSpan(
                      style: style,
                      children: [
                        TextSpan(text: 'why '),
                        WidgetSpan(
                          child: Image.network(
                            width: 26,
                            'https://storage.googleapis.com/cms-storage-bucket/a40ceb6e5d342207de7b.png',
                          ),
                        ),
                        TextSpan(text: 'flutter text layout is so expensive?'),
                      ],
                    ),
                    textAlign: TextAlign.justify,
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
    ),
  );
}
```

### Screenshots or Video

_No response_

### Logs

Flutter 3.22.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 761747bfc5 (3 months ago) • 2024-06-05 22:15:13 +0200
Engine • revision edd8546116
Tools • Dart 3.4.3 • DevTools 2.34.3

### Flutter Doctor output

```
[✓] Flutter (Channel stable, 3.22.2, on macOS 14.6.1 23G93 darwin-arm64, locale zh-Hans-CN)
    • Flutter version 3.22.2 on channel stable at /Users/zjg/fvm/versions/3.22.2
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 761747bfc5 (3 months ago), 2024-06-05 22:15:13 +0200
    • Engine revision edd8546116
    • Dart version 3.4.3
    • DevTools version 2.34.3
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/zjg/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_SDK_ROOT = /Users/zjg/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.14.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.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 17.0.7+0-17.0.7b1000.6-10550314)

[✓] VS Code (version 1.92.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.94.0

[✓] Connected device (5 available)
    • LE2110 (mobile)                    • 192.168.0.104:5555                   • android-arm64  • Android 14 (API 34)
    • iPad Air (5th generation) (mobile) • 9525D3C4-C31B-4DF2-B024-7AC586E6FDA6 • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-17-4 (simulator)
    • 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.119

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```