Repository: flutter
Issue: `meetsGuideline(textContrastGuideline)` passes with white text on almost-white background
Labels: a: tests,framework,has reproducible steps,P2,found in release: 2.10,found in release: 2.13,team-framework,triaged-framework

## Steps to Reproduce

1. Run `flutter create a11y_test` to generate the default Flutter counter app.
2. Replace the contents of main.dart and widget_test.dart with the sample code below.
3. Execute `flutter test` 

I referenced the docs at https://api.flutter.dev/flutter/flutter_test/meetsGuideline.html to write the widget test.

**Expected results:** <!-- what did you want to see? -->
The "text contrast" test fails due to the "0" text being white (`0xffffff`) on very light grey (`0xfafafa`).

**Actual results:** <!-- what did you see? -->
The "text contrast" test passes.

<details>
<summary>Code sample</summary>

main.dart
```dart
void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              const Text(
                'You have pushed the button this many times:',
              ),
              Text(
                '0',
                style: Theme.of(context).textTheme.headline4!.copyWith(
                    color: Colors.white), // Has poor contrast with background
              ),
            ],
          ),
        ),
      ),
    );
  }
}
```

widget_test.dart
```dart
void main() {
  testWidgets('text contrast', (WidgetTester tester) async {
    // Note: the docs don't specify the correct order to call tester.pumpWidget and tester.ensureSemantics,
    // but the test passes no matter which order I call them in.
    final SemanticsHandle handle = tester.ensureSemantics();
    await tester.pumpWidget(const MyApp());
    await expectLater(tester, meetsGuideline(textContrastGuideline));
    handle.dispose();
  });
}
```

</details>

<details>
  <summary>Logs</summary>

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
$ flutter doctor -v
[✓] Flutter (Channel stable, 2.10.5, on macOS 12.3.1 21E258 darwin-x64, locale en-US)
    • Flutter version 2.10.5 at /Users/bryanoltman/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5464c5bac7 (3 weeks ago), 2022-04-18 09:55:37 -0700
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2

[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/bryanoltman/Library/Android/sdk
    • Platform android-stable, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio with Blaze.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.10.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio
    • Android Studio at /Applications/Android Studio with Blaze Beta.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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio with Blaze.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.10+0-b96-7281165)

[✓] IntelliJ IDEA Community Edition (version 2021.2.3)
    • IntelliJ at /Applications/IntelliJ CE (stable).app
    • 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

[✓] VS Code (version 1.67.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.40.0

[✓] Connected device (2 available)
    • iPhone 13 (mobile) • 27CD08D0-9ACA-4C54-B93A-A85A3E830DC6 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-4 (simulator)
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 101.0.4951.54

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 2 categories.
```

</details>


<!--
      Consider also attaching screenshots and/or videos to better
      illustrate the issue.

      You can upload them directly on GitHub.
      Beware that video file size is limited to 10MB.
-->

Screenshot (note the barely visible "0" beneath "You have pushed the button this many times:"):
![simulator_screenshot_B662AB26-3319-45A7-8637-DAF04F6874EB](https://user-images.githubusercontent.com/581764/167226231-c23d99e4-351f-4da6-aa7b-5038086ce21a.png)