Overview
The Air Quality Index (AQI) card is the centerpiece of the Breeze dashboard, displaying the current air quality using the US EPA Air Quality Index standard. It features an animated circular progress indicator, color-coded status levels, and personalized health recommendations.Implementation
AQICard Component
The AQI card is implemented inAQICard.swift as a SwiftUI view that observes the dashboard’s view model:
AQICard.swift
Visual Design
The card features:-
Circular Progress Indicator
- Animated progress ring showing AQI value
- Color changes based on air quality level
- Scales from 0-500 (US AQI range)
-
Large AQI Number
- Bold, rounded font for easy reading
- Color-coded to match air quality status
- “US AQI” label below
-
Status Badge
- Text description (Good, Moderate, Unhealthy, etc.)
- Colored circle indicator
- Detailed health impact description
-
Health Tips
- Contextual recommendations based on AQI level
- Bulleted list format
- Integrated seamlessly into the card
AQI Status Levels
The app uses the standard US EPA AQI categories, defined inAirQuality.swift:
AirQuality.swift
Complete AQI Scale
Excellent (0-25)
Excellent (0-25)
- Color: Green (#34c759)
- Description: Air quality is pristine! Perfect day for adventures.
- Health Impact: Air is exceptionally clean, no concerns
Good (26-50)
Good (26-50)
- Color: Green (#34c759)
- Description: Air quality is great. Breathe easy!
- Health Impact: Air quality meets health standards, pollutant levels are low
Moderate (51-100)
Moderate (51-100)
- Color: Orange (#ff9500)
- Description: Air quality is acceptable for most people.
- Health Impact: Unusually sensitive people may experience minor effects
Unhealthy for Sensitive Groups (101-150)
Unhealthy for Sensitive Groups (101-150)
- Color: Orange-Red (#ff6b00)
- Description: Sensitive groups should be cautious.
- Health Impact: May affect children, elderly, and those with respiratory conditions
Unhealthy (151-200)
Unhealthy (151-200)
- Color: Red (#ff3b30)
- Description: Everyone may feel the effects now.
- Health Impact: Air quality is unhealthy for everyone
Very Unhealthy (201-300)
Very Unhealthy (201-300)
- Color: Purple (#af52de)
- Description: Serious health concerns for everyone.
- Health Impact: Air pollutants are at dangerous levels
Hazardous (301+)
Hazardous (301+)
- Color: Maroon (#8e0000)
- Description: Emergency conditions. Seriously bad air.
- Health Impact: Air quality has reached hazardous levels
Color System
Colors are defined inColor+Theme.swift using hex values:
Color+Theme.swift
Health Recommendations
Each AQI level includes tailored health tips displayed in the card:Sharing Functionality
The AQI card includes a share button using SwiftUI’sShareLink:
Data Source
Air quality data is fetched from the Open-Meteo Air Quality API viaAirQualityService.swift:10-39:
AirQualityService.swift
File Locations
- Component:
BreezeApp/Views/Dashboard/AQICard.swift - Model:
BreezeApp/Models/AirQuality.swift - Service:
BreezeApp/Services/AirQualityService.swift - Colors:
BreezeApp/Extensions/Color+Theme.swift