Skip to main content

Overview

The PollutantsGrid component displays a detailed breakdown of individual air pollutants (PM2.5, PM10, NO2, SO2, O3, CO). Each pollutant is shown in a card-style row that users can tap to view comprehensive details in a modal sheet.

Visual Display

The grid presents:
  • Apple-style grouped list of pollutant cards
  • Color-coded icons for each pollutant type
  • Current concentration values with units
  • Status labels (Good, Moderate, Unhealthy)
  • Tap gesture to open detailed information sheets

Component Definition

Props / Parameters

[PollutantReading]
required
Array of pollutant readings to display. Each PollutantReading contains:
  • type: Pollutant type (PM2.5, PM10, NO2, SO2, O3, CO)
  • value: Current concentration value
  • status: Health status (Good, Moderate, Unhealthy)
  • Icon and unit information

Pollutant Row Component

Each row displays a single pollutant with:

Detail Sheet

Tapping a pollutant opens a comprehensive detail sheet featuring:
  • Large circular icon with status color
  • Current concentration with large typography
  • Status badge
  • “About” section explaining the pollutant
  • Health ranges showing Good/Moderate/Unhealthy thresholds

Pollutant Types

The component supports six major air pollutants:
  1. PM2.5 - Fine Particulate Matter (μg/m³)
  2. PM10 - Coarse Particulate Matter (μg/m³)
  3. NO2 - Nitrogen Dioxide (μg/m³)
  4. SO2 - Sulfur Dioxide (μg/m³)
  5. O3 - Ozone (μg/m³)
  6. CO - Carbon Monoxide (μg/m³)
Each has unique icons, health thresholds, and descriptions.

Health Range Display

The detail sheet includes a RangeRow component showing health thresholds:

Usage in App

Source Location

BreezeApp/Views/Dashboard/PollutantsGrid.swift:3