Skip to main content

Overview

The AQICard is the central UI component on the dashboard that displays the current Air Quality Index (AQI) value. It features an animated circular progress indicator, color-coded status messages, personalized health recommendations, and a share button.

Visual Display

The card presents:
  • Animated circular progress ring showing AQI level (0-500 scale)
  • Large, bold AQI number in the center
  • Color-coded status indicator (Good, Moderate, Unhealthy, etc.)
  • Status description text
  • Health tips section with actionable recommendations
  • Share button for social sharing

Component Definition

Props / Parameters

DashboardViewModel
required
Observable view model that provides:
  • airQuality: Current air quality data including US AQI value
  • aqiColor: Dynamic color based on AQI level (green, yellow, orange, red, purple)
  • aqiStatus: Status object with text description and health tips
  • locationName: Current location for share message

Key Features

Animated Progress Ring

The circular progress indicator animates smoothly when AQI values change:

Health Tips Section

Displays personalized health recommendations based on current AQI level:

Share Integration

Built-in iOS ShareLink for sharing air quality reports:

Color Coding

The component automatically adjusts colors based on AQI levels:
  • Good (0-50): Green
  • Moderate (51-100): Yellow
  • Unhealthy for Sensitive Groups (101-150): Orange
  • Unhealthy (151-200): Red
  • Very Unhealthy (201-300): Purple
  • Hazardous (301+): Maroon

Usage in App

The AQI Card is displayed prominently on the main dashboard:
It updates automatically when new air quality data is fetched from the API.

Source Location

BreezeApp/Views/Dashboard/AQICard.swift:3