accessibility_test 1.0.1 copy "accessibility_test: ^1.0.1" to clipboard
accessibility_test: ^1.0.1 copied to clipboard

discontinued

Automate accessibility checks in your Flutter app. Follows WCAG 2.1 guidelines.

example/EXAMPLE.md

Example usage of accessibility_test.

Theme test #

themeTest(
  'Theme accessibility test',
  themeData,
  accessibilityLevel: ThemeAccessibilityLevel.normal,
);

If any text-background pair does not meet a minimum contrast ratio requirement for given accessibilityLevel, the test will fail with details about the issue, eg:

Contrast ratio of primaryColorLight (Color(0xffbbdefb)) and primaryTextTheme.bodyLarge?.color (Color(0xffffffff)) is 1.40:1, which is not sufficient for specified ThemeAccessibilityLevel.normal. ThemeAccessibilityLevel.normal's lowest acceptable contrast ratio is 4.5:1.

Contrast test #

contrastTest(
  'Contrast readability test',
  backgroundColor,
  textColor,
  readabilityLevel: ReadabilityLevel.normal,
);

If the contrast ratio of given colors does not meet specified readabilityLevel minimum requirement, the test will fails with details about the issue, eg:

1.0:1 contrast ratio of Color(0xffffffff) and Color(0xffffffff) does not meet minimum acceptable contrast ratio for ReadabilityLevel.normal, which is 4.5:1.

2
likes
80
pub points
0%
popularity

Publisher

verified publisherwrbl.xyz

Automate accessibility checks in your Flutter app. Follows WCAG 2.1 guidelines.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (LICENSE)

Dependencies

flutter, meta, test

More

Packages that depend on accessibility_test