flutter_a11y_lens 0.0.1 copy "flutter_a11y_lens: ^0.0.1" to clipboard
flutter_a11y_lens: ^0.0.1 copied to clipboard

Live accessibility auditing for Flutter: inspects the running widget tree and flags WCAG violations in real time, with an on-screen debug overlay.

0.0.1 #

  • Phase 1: internal ElementTreeWalker for capturing live widget tree snapshots (widget type, global bounds, explicit Semantics), plus the A11yRule / A11yViolation / A11ySeverity data model checks will build on.
  • Phase 2: ContrastRule (WCAG AA/AAA text contrast, with an ancestor background lookup) and TapTargetSizeRule (48x48dp minimum, configurable size and widget set), backed by the pure-math ColorContrast utility. No public overlay yet.
  • Phase 3: A11yLensOverlay, the debug overlay — wraps the app, re-walks after every frame, and draws a tap-to-inspect outline over each violation. No-op in release builds. A11yViolation gained value equality so the overlay's selection survives re-walks producing fresh instances of the same issue.
  • Phase 4: SemanticsTreeWalker, reading the real SemanticsNode tree rather than the Element tree, plus SemanticLabelRule and FocusOrderRule built on it — catching widgets that set semantics via a custom RenderObject (not just an explicit Semantics widget), same as a screen reader would encounter them. Both are on by default in A11yLensOverlay, which now manages the SemanticsHandle they need.
  • Phase 5: A11yReport (JSON/Markdown export, baseline diffing via newViolationsComparedTo) and package:flutter_a11y_lens/testing.dart's expectNoA11yViolations, a headless flutter test harness for CI. A11yViolation.widgetType changed from Type? to String? so violations round-trip losslessly through JSON (a Type can't be reconstructed from a string) — a breaking change for anyone matching on it directly.
  • Renamed the package from a11y_lens to flutter_a11y_lens: pub.dev already has an unrelated package published under the former name.
  • Fixed SemanticsTreeWalker.walk(context) to actually scope to context's subtree, matching ElementTreeWalker. It previously ignored context for finding the tree root and always walked the whole view — harmless for A11yLensOverlay (which only avoided self-flagging via excludeFromSemantics, not scoping) but silently broke the finder/ context scoping A11yReport.generate and expectNoA11yViolations promise for semantics-based rules.
  • Phase 6: the example app now has a live before/after toggle (SwitchListTile) demonstrating one deliberate violation per rule, each isolated in its own card, fixed in place, plus a regression test proving the fix genuinely clears them.
  • Fixed the example app's SemanticLabelRule demo card: its unlabeled GestureDetector had no semantics boundary of its own, so its tap action merged upward into the card's title/description text — which gave the merged node a non-empty "label" (the surrounding paragraph) and made the violation undetectable. Wrapped it in a tight Semantics(container: true) boundary.
  • README rewritten with full installation/usage/CI instructions, a rules reference table, and screenshots of the example app's overlay and tap-to-inspect popovers.
1
likes
160
points
69
downloads

Documentation

API reference

Publisher

verified publisherehsanur.com

Weekly Downloads

Live accessibility auditing for Flutter: inspects the running widget tree and flags WCAG violations in real time, with an on-screen debug overlay.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, flutter_test

More

Packages that depend on flutter_a11y_lens