Overview
The Pollutants Grid provides detailed monitoring of six major air pollutants, each with its own card showing current levels, status, and health information. Users can tap any pollutant to view comprehensive details in a modal sheet.Tracked Pollutants
Breeze monitors six key air pollutants:- PM2.5 - Fine Particulate Matter
- PM10 - Coarse Particulate Matter
- NO₂ - Nitrogen Dioxide
- SO₂ - Sulfur Dioxide
- O₃ - Ground-Level Ozone
- CO - Carbon Monoxide
Implementation
PollutantsGrid Component
The pollutants grid is implemented as a list-style layout with tappable rows:PollutantsGrid.swift
Pollutant Row Design
Each pollutant is displayed in a clean, information-dense row:PollutantsGrid.swift
Pollutant Type Definitions
Each pollutant is defined with its properties inPollutant.swift:
Pollutant.swift
Health Thresholds
Each pollutant has defined health thresholds for good, moderate, and unhealthy levels:- PM2.5
- PM10
- NO₂
- SO₂
- O₃
- CO
- Good: 0-12 µg/m³
- Moderate: 12.1-35.4 µg/m³
- Unhealthy: >35.4 µg/m³
- Icon: wind
- Description: Fine particulate matter that penetrates deep into lungs
Detail Sheet
Tapping a pollutant opens a comprehensive detail sheet with:Hero Section
- Large icon with status color background
- Pollutant name and full chemical name
- Current reading with large, bold numbers
- Status badge (Good, Moderate, Unhealthy)
Information Sections
- About - Detailed description of the pollutant and its sources
- Health Ranges - Visual representation of threshold levels with color coding
PollutantsGrid.swift
Status Calculation
Pollutant status is calculated based on threshold values:Pollutant.swift
Data Integration
Pollutant data is derived from the air quality response inDashboardViewModel.swift:119-126:
File Locations
- Component:
BreezeApp/Views/Dashboard/PollutantsGrid.swift - Model:
BreezeApp/Models/Pollutant.swift - Service:
BreezeApp/Services/AirQualityService.swift