refactor: add shared StoplightColors for consistent status colors

- Add StoplightColors class with green/orange/red pastel colors
- Update dashboard gauges to use StoplightColors.forPercent()
- Update air quality levels to use shared stoplight colors
- Provides consistent color scheme for all threshold-based indicators

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Jeroen Schweitzer
2026-01-03 18:33:42 +01:00
co-authored by Claude Opus 4.5
parent 67fed18cb0
commit 6c271489a9
3 changed files with 47 additions and 20 deletions
+5 -4
View File
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:tatlock_ui/shared/theme/stoplight_colors.dart';
/// Air Quality Index widget displaying current AQI.
///
@@ -203,28 +204,28 @@ enum AqiLevel {
good(
label: 'Good',
description: 'Air quality is satisfactory',
color: Colors.green,
color: StoplightColors.green,
minIndex: 0,
maxIndex: 50,
),
moderate(
label: 'Moderate',
description: 'Acceptable for most people',
color: Colors.amber,
color: StoplightColors.orange,
minIndex: 51,
maxIndex: 100,
),
unhealthySensitive(
label: 'Unhealthy for Sensitive',
description: 'May affect sensitive groups',
color: Colors.orange,
color: StoplightColors.orange,
minIndex: 101,
maxIndex: 150,
),
unhealthy(
label: 'Unhealthy',
description: 'Health effects for everyone',
color: Colors.red,
color: StoplightColors.red,
minIndex: 151,
maxIndex: 200,
),