high priority medium complexity frontend pending frontend specialist Tier 1

Acceptance Criteria

DeclarationSendScreen renders an AppBar with a back button that pops the current route
The screen body is wrapped in a SingleChildScrollView to support variable-length declaration template previews
A clearly labeled template preview section placeholder is present with a distinct visual container (card or bordered region) using design tokens
A driver contact display area shows at minimum: driver name placeholder, contact role, and a masked phone/email placeholder with a design-token-compliant layout
Two action buttons are present: 'Send' (primary AppButton style) and 'Re-send' (secondary AppButton style), both using design tokens for sizing and color
Both action buttons are disabled (non-interactive) in this shell task — BLoC wiring is done in task-005
Navigation route is registered in the app router so that tapping a driver assignment list item navigates to DeclarationSendScreen with the correct assignment ID as a route parameter
Screen is wrapped inside DriverFeatureFlagGuard to prevent access from non-Blindeforbundet organizations
All touch targets meet minimum 44x44dp WCAG 2.2 AA requirement
Screen passes flutter analyze with zero warnings
Widget test confirms AppBar title text, Send button presence, Re-send button presence, and scrollable body are all rendered

Technical Requirements

frameworks
Flutter
BLoC
Riverpod
data models
confidentiality_declaration
assignment
contact
performance requirements
Initial screen render must complete within 2 frames on a mid-range device
Scrollable body must not cause jank when content exceeds viewport height
security requirements
Assignment ID passed via route parameter must be validated — screen must not accept arbitrary IDs without authorization check (handled in BLoC layer in task-005)
Driver contact PII displayed on this screen must never be logged or cached in plain text
Screen must not be reachable without DriverFeatureFlagGuard wrapping
ui components
AppBar
SingleChildScrollView
AppButton (primary)
AppButton (secondary)
Card/BorderedContainer (template preview placeholder)
DriverContactDisplayWidget (placeholder)
DriverFeatureFlagGuard

Execution Context

Execution Tier
Tier 1

Tier 1 - 540 tasks

Can start after Tier 0 completes

Implementation Notes

Use GoRouter for route registration. Define a named route constant (e.g., AppRoutes.declarationSend) accepting an assignmentId path parameter. The screen should be a ConsumerStatefulWidget to support BLoC integration in task-005 without refactoring. For the template preview placeholder, use a Container with a dashed border or a Card with a subtle background from design tokens and a centered Text('Template preview') label — this will be replaced in task-005.

Keep all colors, spacing, and typography strictly from design tokens — no hardcoded values. Use the existing AppButton widget for both action buttons. Driver contact display area should use the existing contact card widget pattern if available, or a simple Column with Text widgets using design token styles.

Testing Requirements

Widget tests using flutter_test. Test cases: (1) screen renders without exception given a valid assignment ID, (2) AppBar back button is present and tappable, (3) Send button is present with correct label, (4) Re-send button is present with correct label, (5) both buttons are disabled in shell state, (6) scrollable body renders without overflow errors with long placeholder content, (7) navigating to the screen with a route param sets the screen title or header correctly. No golden tests required at this stage — visual polish is handled in later tasks.

Epic Risks (3)
high impact medium prob technical

The declaration acknowledgement screen has the most complex accessibility requirements of any screen in this feature: scrollable long-form legal text, a conditional checkbox that is only enabled after reading, and a timestamp capture. Incorrect focus management or missing semantics annotations could fail VoiceOver navigation or cause the screen reader to announce the checkbox as available before the driver has scrolled, undermining the legal validity of the acknowledgement.

Mitigation & Contingency

Mitigation: Build the acknowledgement screen against the WCAG 2.2 AA checklist from the start, not as a post-hoc audit. Use semantics-wrapper-widget and live-region-announcer from the platform's accessibility toolkit. Include a VoiceOver test session in the acceptance criteria with a tester using the screen reader.

Contingency: If WCAG compliance cannot be fully achieved within the sprint, ship the screen with a documented list of accessibility gaps and a follow-up sprint commitment. Do not block the declaration workflow launch if the core interaction works but a non-critical semantics annotation is missing.

medium impact medium prob integration

Drivers receive a push notification with a deep link to the declaration acknowledgement screen for a specific assignment. If the deep link handler does not correctly route to the right screen and assignment context — particularly when the app is launched cold from the notification — the driver may see a blank screen or the wrong declaration.

Mitigation & Contingency

Mitigation: Implement and test all three notification scenarios: app foregrounded, app backgrounded, and cold start. Use the platform's existing deep-link-handler infrastructure. Add integration tests that simulate notification tap events and assert correct screen and data loading.

Contingency: If cold-start deep link routing proves unreliable, implement a notification-centre fallback where the driver can find the pending declaration from the notification centre screen, ensuring the workflow can always complete even if the direct deep link fails.

medium impact low prob technical

If the driver-feature-flag-guard has any rendering edge case — such as a brief flash of driver UI before the flag value is loaded, or a guard that fails open on a flag service error — driver-specific UI elements could be momentarily visible to coordinators in organizations that have not opted in, causing confusion and potentially a support escalation.

Mitigation & Contingency

Mitigation: Default the guard to rendering nothing (not a loading indicator) until the flag value is definitively resolved. Treat flag service errors as flag-disabled to fail closed. Write widget tests covering the loading, disabled, and enabled states including the error case.

Contingency: If fail-closed cannot be guaranteed within the sprint, add a server-side RLS check on the driver assignment endpoints so that even if the UI guard leaks, the data layer refuses to return driver data for organizations without the flag enabled.