meetsGuideline function
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
final SemanticsHandle handle = tester.ensureSemantics();
await meetsGuideline(tester, meetsGuideline(textContrastGuideline));
handle.dispose();
Supported accessibility guidelines:
- androidTapTargetGuideline, for Android minimum tapable area guidelines.
- iOSTapTargetGuideline, for iOS minimum tapable area guidelines.
- textContrastGuideline, for WCAG minimum text contrast guidelines.
Implementation
AsyncMatcher meetsGuideline(AccessibilityGuideline guideline) {
return _MatchesAccessibilityGuideline(guideline);
}