meetsGuideline function

AsyncMatcher meetsGuideline(
  1. AccessibilityGuideline guideline
)

Asserts that the currently rendered widget meets the provided accessibility guideline.

This matcher requires the result to be awaited and for semantics to be enabled first.

Sample code

testWidgets('containsSemantics', (WidgetTester tester) async {
  final SemanticsHandle handle = tester.ensureSemantics();
  // ...
  await expectLater(tester, meetsGuideline(textContrastGuideline));
  handle.dispose();
});

Supported accessibility guidelines:

Implementation

AsyncMatcher meetsGuideline(AccessibilityGuideline guideline) {
  return _MatchesAccessibilityGuideline(guideline);
}