Implement navigation route configuration reader
epic-navigation-and-gesture-accessibility-service-and-audit-task-002 — Implement the NavigationRouteConfig reader that introspects the GoRouter route tree, extracts all declared routes with their metadata (modal vs non-root vs root), and exposes a typed list of RouteDescriptor objects. This is a prerequisite for both the service and the audit runner to know the full route landscape.
Acceptance Criteria
Technical Requirements
Execution Context
Tier 1 - 540 tasks
Can start after Tier 0 completes
Implementation Notes
GoRouter exposes its route tree via `GoRouter.configuration.routes` (a `List
Do not attempt to instantiate or pump widgets during introspection — work only with the configuration objects. If the project's GoRouter instance is provided via Riverpod, accept a `GoRouter` parameter in the constructor rather than using a global to keep the class testable.
Testing Requirements
Unit tests using flutter_test. Test suite must cover: (1) empty GoRouter config returns empty list, (2) flat list of root GoRoutes all classified as isRoot, (3) nested routes classified as isNonRoot, (4) fullscreenDialog:true GoRoute classified as isModal, (5) StatefulShellRoute children classified correctly, (6) mixed tree with all three route types produces correct classification for each. No integration tests required for this task — the reader is a pure data extraction utility. Target 100% branch coverage on the classification logic.
Flutter's SemanticsController used in integration tests is an internal or semi-internal API that can break between Flutter stable releases. If the audit runner relies heavily on undocumented semantics tree traversal, a Flutter upgrade could silently disable the audit checks without a build failure, creating false confidence.
Mitigation & Contingency
Mitigation: Use only the public flutter_test accessibility APIs (meetsGuideline, SemanticsController.ensureSemantics) and wrap all SemanticsController calls in a versioned helper class with explicit assertions that the expected semantics tree shape is still available. Pin the Flutter SDK range in pubspec.yaml.
Contingency: If SemanticsController APIs break on a Flutter upgrade, fall back to widget-level golden tests that include the semantics tree snapshot, combined with manual Switch Access and VoiceOver QA checklists executed before each release.
Flutter integration tests that simulate Switch Access traversal on multiple screens can be slow (30–120 seconds per test flow), which may make the audit runner impractical to run on every CI commit if the test suite already has long run times.
Mitigation & Contingency
Mitigation: Scope the audit runner to a dedicated integration test target that runs on pull requests targeting main and on nightly builds, not on every push. Parallelise test shards in CI to keep wall-clock time acceptable. Profile audit run times during development and trim any flows that duplicate coverage.
Contingency: If CI run times exceed acceptable thresholds, split the audit runner into a fast smoke suite (touch targets and semantic labels only, runs on every PR) and a thorough traversal suite (Switch Access simulation, runs nightly), with the nightly failure blocking the release branch rather than every PR.