Repository: flutter
Issue: TextOverflow.fade effect in RichText inverted when using WidgetSpan with ShaderMask
Labels: framework,a: typography,P2,team-framework,triaged-framework

### 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. Add a RichText widget with WidgetSpan with ShaderMask 
2. Make the RichText single-line and specify the TextOverflow.fade effect.

### Expected results

There will be a correct fading effect with a decrease in transparency.

### Actual results

It is painted in black with reverse fading of transparency.

### Code sample

<details><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(const MainApp());
}

class MainApp extends StatelessWidget {
  const MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Column(
          children: [
            RichText(
              maxLines: 1,
              overflow: TextOverflow.fade,
              softWrap: false,
              text: const TextSpan(
                children: [
                  WidgetSpan(
                    child: GradientText(
                      'test text test ',
                      fillGradient: LinearGradient(
                        colors: [
                          Colors.red,
                          Colors.blue,
                        ],
                      ),
                    ),
                  ),
                  WidgetSpan(
                    child: GradientText(
                      ' test text test',
                      fillGradient: LinearGradient(
                        colors: [
                          Colors.red,
                          Colors.blue,
                        ],
                      ),
                    ),
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}

class GradientText extends StatelessWidget {
  const GradientText(
      this.data, {
        super.key,
        required this.fillGradient,
      });

  final String data;
  final Gradient fillGradient;

  @override
  Widget build(BuildContext context) {
    return ShaderMask(
      blendMode: BlendMode.srcIn,
      shaderCallback: (bounds) => fillGradient.createShader(bounds),
      child: Text(
        data,
        style: const TextStyle(
          fontSize: 48,
          fontWeight: FontWeight.bold,
        ),
      ),
    );
  }
}
```

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

<img width="522" alt="Screen Shot 2023-06-02 at 10 58 28" src="https://github.com/flutter/flutter/assets/87495835/6c64dd20-c62d-49a6-86fd-e64385c86009">


</details>


### Logs

_No response_

### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
➜  ~ flutter doctor -v
[✓] Flutter (Channel stable, 3.7.11, on macOS 12.6.2 21G320 darwin-arm64, locale en)
    • Flutter version 3.7.11 on channel stable at /Users/man-y/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f72efea43c (7 weeks ago), 2023-04-11 11:57:21 -0700
    • Engine revision 1a65d409c7
    • Dart version 2.19.6
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/man-y/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.12.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • 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.6+0-17.0.6b802.4-9586694)

[✓] IntelliJ IDEA Ultimate Edition (version 2023.1.1)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 73.1.1
    • Dart plugin version 231.9065

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 12.6.2 21G320
      darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 114.0.5735.90

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
```

</details>