attest_flutter 1.5.0
attest_flutter: ^1.5.0 copied to clipboard
Flutter widget-test integration for attest: a WidgetTester accessibility audit, raster and text-scale collectors, and gate matchers for CI.
Changelog #
All notable changes to this package are documented here. The format follows Keep a Changelog and this project adheres to Semantic Versioning.
1.5.0 - 2026-07-15 #
Changed #
- The contrast raster pass is substantially faster on busy screens. The background scan now reads packed pixels straight from the buffer instead of allocating an object per pixel, and it subsamples large text boxes with a stride — the background is taken as the mode, which a uniform stride over a solid field leaves unchanged. On a 240-node screen collection dropped from ~145 ms to ~40 ms (the pixel scan itself ~13× faster; the remaining cost is the fixed rasterization). Measured ratios are unchanged: the reference pairs still validate, and a new test pins that a box far larger than the sampling cap yields the same contrast. No API change.
1.4.0 - 2026-07-15 #
Added #
- The gate-failure output now prints a finding's
codeExample— a ready-to-paste// Before/// Aftersnippet — indented under the fix, so the remedy is right there in the failing test. Requiresattest1.10.0.
1.3.0 - 2026-07-15 #
Added #
- The gate-failure output now adds a "Learn:" line under each violation with the
W3C "Understanding" URL for its criterion, so the path from a failing test to
the authoritative guidance is one click. Requires
attest1.9.0.
1.2.2 - 2026-07-14 #
Added #
- Documented auditing on a device with
integration_test:auditAccessibilityworks unchanged on a live binding, so the rendered app can be audited on a device or desktop (native semantics, real focus). A runnable example lives atexample/integration_test. Contrast needs a debug build; the overflow pass relies on a test-only re-pump, so start withtextScales: [1.0]on device.
1.2.1 - 2026-07-02 #
Changed #
- Require
attest1.7.0 forFlowAnalysis, which diffsauditFlowreports to show which step introduced a barrier; documented in the flow section.
1.2.0 - 2026-07-02 #
Added #
tester.auditFlow(...)andAuditStep: audit across interactions, not just one static screen. It drives a scripted flow (tap, scroll, navigate) and re-audits after each step, catching barriers that only appear in motion — an unlabeled control in a dialog, semantics that break on a state change, a focus trap that only exists post-navigation. Returns one labelled report per step. Experimental; the flow API will grow.
1.1.2 - 2026-07-02 #
Changed #
- Require
attest1.6.0, which adds theattest/generic-link-textrule (WCAG 2.4.4): links with vague text like "read more" are now flagged. No API change in this package.
1.1.1 - 2026-07-02 #
Changed #
- Require
attest1.5.0, which adds theattest/adjustable-valuerule (WCAG 4.1.2): sliders and steppers that expose no current value are now flagged. No API change in this package.
1.1.0 - 2026-07-02 #
Added #
- The raster collector detects icon glyphs (Private Use Area code points) and
marks their samples as non-text, so the new
attest/non-text-contrastrule (WCAG 1.4.11) can hold them to the 3:1 minimum. Requiresattest1.1.0.
Fixed #
- A small icon whose contrast is between 3:1 and 4.5:1 is no longer flagged as a text-contrast failure.
1.0.0 - 2026-07-02 #
First stable release. Requires attest 1.0.0.
Added #
- The snapshot builder captures the developer-assigned
SemanticsProperties.identifier, and the raster collector attaches the nearest semantics identifier to each contrast sample, so findings can be anchored to an authored, stable id. - Reference validation of the measurement paths: the contrast pipeline is checked end to end against a table of known colour pairs (within 0.1 of independently computed WCAG ratios), gradient and disabled-control abstention are pinned by test, and the overflow fixture is proven to fit at text scale 1.0 and overflow at 2.0.
Changed #
- The public API is frozen for 1.0:
auditAccessibility, the gate matchers and the re-exported core are stable within a major. The plumbing classes (SemanticsSnapshotBuilder,RasterCollector,TextScaleCollector) are annotated@experimental— ordinary tests never need them directly, and their signatures may still evolve forintegration_testsupport. - Stated the version-support policy: Flutter ≥ 3.32 is a hard floor (the
tri-state
flagsCollectionsemantics API), with the current and previous three stable Flutter releases supported and each new stable tracked within one release cycle.
0.8.3 #
Fixed #
- Report the correct tool version.
attestVersionwas stuck at0.1.0, so the report metadata and SARIFtool.driver.versionwere wrong; it is now kept in sync with the package version by a test.
0.8.2 #
Fixed #
- Correct the SDK constraint: the package uses the
SemanticsData.flagsCollectiontri-state API, so it requires Flutter >= 3.32.0 (Dart >= 3.8.0). The previous>= 3.27.0bound was inaccurate and would fail to compile on 3.27–3.31.
0.8.1 #
Changed #
- Source locations now prefer the user's own code: the resolver walks up from the creating element and returns the first location outside the Flutter SDK and pub packages, so a finding on a wrapped Material control points at where the developer used it rather than at framework internals.
0.8.0 #
Changed #
- The audited standard pack comes from
RuleConfig.standardand is recorded in the report metadata. Requiresattest0.8.0.
0.7.0 #
Added #
auditAccessibilityattaches a screen-reader transcript to the report by default (opt out withtranscript: false). Requiresattest0.7.0.
0.6.0 #
Added #
- The snapshot builder now records each text node's font size and weight (from the render tree), which the heading-structure rule reads.
Fixed #
- Children are captured in the real traversal order (sort keys + geometry) via
debugListChildrenInOrder, not the raw child order, so the focus-order rule no longer false-positives on a standardScaffoldapp bar.
0.5.0 #
Added #
- Findings now carry a source location. The snapshot builder recovers each
node's originating widget location from the render tree's debug creator (via a
new
renderRootargument), so a failure points atfile:line. Best-effort: it relies on--track-widget-creation(on by default underflutter test).
0.4.0 #
Added #
RasterCollectorand thecontrastflag onauditAccessibility: the screen is rasterized and each text node's contrast against its real background is measured for the contrast rule. Requiresattest0.4.0.
0.3.0 #
Added #
TextScaleCollectorand thetextScalesparameter onauditAccessibility: the screen is re-pumped at enlarged text sizes and layout overflow is captured into the snapshot for the text-overflow rule. Requiresattest0.3.0.
0.2.0 #
Changed #
- The snapshot builder now resolves node bounds to logical pixels (dividing the
accumulated physical rect by the view's device pixel ratio), so the geometry
rules see real sizes. Requires
attest0.2.0.
0.1.0 #
Added #
SemanticsSnapshotBuilder, which converts a live Flutter semantics tree into the pure-DartSemanticsSnapshot(mapping the 3.xflagsCollectionAPI).WidgetTester.auditAccessibility(), the one-call audit entry point (tree rules only).- The gate matchers
passesAccessibilityGate(),hasNoAccessibilityViolations()andhasNoViolationsForCriterion(), with grouped, criterion-tagged failure output.