critical priority low complexity frontend pending frontend specialist Tier 1

Acceptance Criteria

An `AppTypographyTokens` class (or a merged `AppDesignTokens` extension) exposes `TextStyle` fields for: `displayLarge`, `displayMedium`, `headlineLarge`, `headlineMedium`, `headlineSmall`, `bodyLarge`, `bodyMedium`, `bodySmall`, `labelLarge`, `labelMedium`, `labelSmall`, `captionRegular`
Each `TextStyle` token encodes `fontSize`, `fontWeight`, `height` (line height ratio), and `letterSpacing` — no field is left as Flutter's default/null
An `AppSpacingTokens` class (or merged extension) exposes `double` constants for: `spacing2` (2px), `spacing4`, `spacing8`, `spacing12`, `spacing16`, `spacing20`, `spacing24`, `spacing32`, `spacing40`, `spacing48`, `spacing64`
A `AppRadiusTokens` class (or merged extension) exposes `BorderRadius` constants for: `radiusSmall` (4), `radiusMedium` (8), `radiusLarge` (16), `radiusXL` (24), `radiusFull` (999)
`copyWith` and `lerp` are correctly implemented for all new extensions
No widget in the codebase uses a numeric literal for padding, font size, or border radius where a token exists for that value
A smoke-compile test (or widget test) confirms all token fields are reachable from `BuildContext` without null errors

Technical Requirements

frameworks
Flutter
performance requirements
All token values are compile-time constants (`const`) where possible to eliminate runtime allocation
ui components
ThemeExtension (AppTypographyTokens or merged AppDesignTokens)

Execution Context

Execution Tier
Tier 1

Tier 1 - 540 tasks

Can start after Tier 0 completes

Implementation Notes

If the existing codebase already has a `ThemeExtension` from task-002, merge typography and spacing into the same extension class or create a second extension registered alongside it. Keep font families consistent with the app's existing `fontFamily` setting in `ThemeData` — do not hard-code a new family here. For the type scale, use an 8-point grid (multiples of 4 or 8) to maintain rhythm. For `lerp` on spacing doubles, use `lerpDouble`.

For `TextStyle` lerp, delegate to `TextStyle.lerp`. Mark all numeric constants as `static const` to benefit from tree-shaking and avoid re-allocation on every `build`.

Testing Requirements

Unit/widget tests with `flutter_test`. Test 1: each typography token `TextStyle` has non-null `fontSize` and `fontWeight`. Test 2: each spacing token is a positive non-zero `double`. Test 3: `lerp` on typography tokens at `t=0` returns the original instance values.

Lint enforcement: add a custom lint rule or `dart analyze` comment to flag bare numeric literals for padding/font sizes in widget files (optional but recommended).

Component
Design Token Theme
infrastructure low
Epic Risks (2)
high impact medium prob integration

The design token theme extension may conflict with existing ThemeData extensions already registered in the app, causing runtime assertion errors or token resolution failures across all screens that consume the tokens.

Mitigation & Contingency

Mitigation: Audit all existing ThemeData extensions before implementation. Use a unique extension key namespace and add integration tests that instantiate the combined theme in a test app harness.

Contingency: If conflicts arise, isolate design tokens behind a dedicated provider singleton (Riverpod) rather than a ThemeData extension, updating all consuming widgets to read from the provider instead.

medium impact medium prob scope

The 30-day warning threshold for expiring_soon status may differ between HLF's stated requirement in workshops (60 days mentioned in user stories) and the 30-day value in component documentation, causing disagreement during acceptance testing.

Mitigation & Contingency

Mitigation: Explicitly confirm the threshold value with HLF stakeholder before implementation. Make the threshold a named constant (kCertificationWarnDays) so it can be updated without logic changes.

Contingency: If stakeholder confirms 60 days post-implementation, update the constant and re-run the unit test suite — no architectural change required.