A Flutter mobile application for real-time weather monitoring and air quality tracking β with AQI metrics, pollutant breakdowns, multi-day forecasts, and personalized health recommendations.
π¦ Repository: github.com/DangHuuLong/Weather-App
Weather App is a Flutter application that combines live weather data and air quality index (AQI) information into a single mobile experience. Users are guided through an onboarding flow, authenticate via login, and land on a dashboard displaying current conditions, pollutant levels, hourly and 7-day forecasts, and AI-generated health recommendations based on live data.
The app integrates with WeatherAPI for weather data and WAQI for air quality data, using reverse geocoding to resolve human-readable location names from coordinates.
- π¬οΈ Onboarding β Multi-slide intro experience focused on breathing quality, pollution tracking, and exposure control
- π Login β Email/password authentication with input validation
- π Home Dashboard β Current weather, AQI overview, and upcoming forecast UI with cached data support
- π Location Details β Deep-dive view with pollutant metrics (Oβ, PM10, NOβ, PM2.5, SOβ, CO), hourly weather, 7-day AQ forecast, 7-day weather forecast, and recommendation cards
- π AQI Scale β Reference screen explaining AQI ranges and health categories
- ποΈ Data Bank β Data request form UI routing to location detail views
- π€ More β Profile and settings menu including Saved Locations, FAQ, Settings, About Us, Contact Us, and Logout
- πΎ Local Caching β Weather data and auth tokens stored locally via SharedPreferences
- π Reverse Geocoding β Derives street/location names from device coordinates
App Launch
βββ Onboarding (multi-slide intro)
βββ Login (email + password validation)
βββ Root Page (bottom navigation)
βββ π Home
β βββ Location Details
β βββ AQI Scale
βββ ποΈ Data Bank
βββ π€ More
After a successful login, the app navigates to the main shell with a bottom navigation bar. Auth tokens are persisted locally so returning sessions can be restored.
| Concern | Technology |
|---|---|
| Framework | Flutter |
| Language | Dart |
| State Management | provider + flutter_bloc |
| HTTP Client | dio |
| Local Storage | shared_preferences |
| Geocoding | geocoding |
| Code Generation | freezed + json_serializable |
| Weather Data | WeatherAPI |
| Air Quality Data | WAQI |
| Auth API | EscuelaJS |
The project follows a layered architecture separating data access, state, and UI concerns:
ββββββββββββββββββββββββββββββββββββ
β UI Layer β
β (page/ β screens & widgets) β
ββββββββββββββββ¬ββββββββββββββββββββ
β
ββββββββββββββββΌββββββββββββββββββββ
β State Layer β
β (providers/ + flutter_bloc) β
ββββββββββββββββ¬ββββββββββββββββββββ
β
ββββββββββββββββΌββββββββββββββββββββ
β Data Layer β
β api/ Β· models/ Β· storage/ β
ββββββββββββββββ¬ββββββββββββββββββββ
β
ββββββββββββ΄βββββββββββ
βΌ βΌ
WeatherAPI WAQI
(weather + forecast) (air quality)
api/β Remote service calls (WeatherAPI, WAQI, auth)models/β Typed data models, generated withfreezedandjson_serializablestorage/β Local persistence for tokens and cached weather dataproviders/β Lightweight app-level state usingproviderpage/β All screens and UI modules
weather_app/
βββ lib/
β βββ api/ # Remote API service classes
β βββ models/ # Dart data models (freezed/json)
β βββ page/
β β βββ aqi_scale/ # AQI scale reference screen
β β βββ data_bank/ # Data request form UI
β β βββ home/ # Home dashboard screen
β β βββ location_details/ # Detailed AQ + weather view
β β βββ login.dart # Login screen
β β βββ more.dart # Profile / settings menu
β β βββ on_boarding.dart # Onboarding slides
β β βββ root_page.dart # Bottom nav shell
β βββ providers/ # Provider-based app state
β βββ storage/ # SharedPreferences helpers
β βββ main.dart # App entry point
βββ assets/ # Images, icons, static files
βββ android/
βββ ios/
βββ linux/
βββ macos/
βββ web/
βββ windows/
βββ test/
βββ pubspec.yaml
βββ README.md
Used to fetch current weather conditions, hourly forecasts, and 7-day weather forecasts based on location.
Used to fetch real-time AQI data and individual pollutant readings including Oβ, PM10, NOβ, PM2.5, SOβ, and CO.
Reverse geocoding via the geocoding package resolves human-readable street and location names from device coordinates.
Login and token management is handled via the EscuelaJS public API.
β οΈ API keys and tokens are currently configured directly in the source code. Ensure valid credentials are in place before running the app against live services.
The app persists the following data locally using shared_preferences:
| Key | Contents |
|---|---|
| Access token | JWT access token from login |
| Refresh token | JWT refresh token |
| Cached weather | Latest weather response for the default location |
Cached weather data is used on the Home screen when fresh data is unavailable.
The project uses two complementary state management approaches:
providerβ Lightweight app-level state such as auth status and shared UI stateflutter_blocβ Bloc/Cubit pattern for more structured state in specific screens
Not every screen is fully wired to Bloc in the current implementation; some screens use Provider or local state directly.
Multi-slide introduction to the app. Messaging covers breathing better, tracking air pollution, and managing exposure. Leads to the login screen.
Email and password form with validation. On success, navigates to the main app shell. Auth tokens are stored locally.
Displays current weather conditions and AQI for the current location. Shows a short forecast UI. Uses cached data when available and navigates to Location Details for a deeper view.
Note: The current implementation uses a default city configured in code.
The most data-dense screen. Shows:
- Current weather
- Pollutant breakdown: Oβ, PM10, NOβ, PM2.5, SOβ, CO
- Hourly weather timeline
- 7-day air quality forecast
- 7-day weather forecast
- Recommendation cards generated from live weather and AQ data
Informational screen explaining AQI value ranges and their associated health categories.
Form-based UI for data requests. Current implementation is primarily UI-driven and routes to location detail views.
Profile and settings menu with the following items:
- Profile
- Saved Location
- FAQ
- Settings
- About Us
- Contact Us
- Logout
- Flutter SDK (stable channel recommended)
- Dart (included with Flutter)
- Android Studio, VS Code, or another Flutter-compatible IDE
- A connected device or emulator
# Clone the repository
git clone https://github.com/DangHuuLong/Weather-App.git
cd Weather-App
# Install dependencies
flutter pub getflutter runTo generate code for freezed and json_serializable models:
dart run build_runner build --delete-conflicting-outputs- The Home screen uses a default city value hard-coded in source. Dynamic location-based fetching may require additional permission and GPS configuration.
- API keys for WeatherAPI and WAQI are currently embedded in the source code. For any fork or deployment, replace these with your own valid credentials.
- The Data Bank screen is primarily UI-driven in the current state; a full backend data request flow has not been confirmed.
- Some More menu items (e.g. Saved Location, Settings, About Us) may be partially implemented.
- The project integrates both
providerandflutter_bloc; state management coverage varies across screens. - Live data depends on active and valid API subscriptions to WeatherAPI and WAQI.
Built with β€οΈ by DangHuuLong using Flutter & Dart
Repository
A Flutter mobile application for real-time weather monitoring and air quality tracking β with AQI metrics, pollutant breakdowns, multi-day forecasts, and personalized health recommendations.
π¦ Repository: github.com/DangHuuLong/Weather-App
Weather App is a Flutter application that combines live weather data and air quality index (AQI) information into a single mobile experience. Users are guided through an onboarding flow, authenticate via login, and land on a dashboard displaying current conditions, pollutant levels, hourly and 7-day forecasts, and AI-generated health recommendations based on live data.
The app integrates with WeatherAPI for weather data and WAQI for air quality data, using reverse geocoding to resolve human-readable location names from coordinates.
- π¬οΈ Onboarding β Multi-slide intro experience focused on breathing quality, pollution tracking, and exposure control
- π Login β Email/password authentication with input validation
- π Home Dashboard β Current weather, AQI overview, and upcoming forecast UI with cached data support
- π Location Details β Deep-dive view with pollutant metrics (Oβ, PM10, NOβ, PM2.5, SOβ, CO), hourly weather, 7-day AQ forecast, 7-day weather forecast, and recommendation cards
- π AQI Scale β Reference screen explaining AQI ranges and health categories
- ποΈ Data Bank β Data request form UI routing to location detail views
- π€ More β Profile and settings menu including Saved Locations, FAQ, Settings, About Us, Contact Us, and Logout
- πΎ Local Caching β Weather data and auth tokens stored locally via SharedPreferences
- π Reverse Geocoding β Derives street/location names from device coordinates
App Launch
βββ Onboarding (multi-slide intro)
βββ Login (email + password validation)
βββ Root Page (bottom navigation)
βββ π Home
β βββ Location Details
β βββ AQI Scale
βββ ποΈ Data Bank
βββ π€ More
After a successful login, the app navigates to the main shell with a bottom navigation bar. Auth tokens are persisted locally so returning sessions can be restored.
| Concern | Technology |
|---|---|
| Framework | Flutter |
| Language | Dart |
| State Management | provider + flutter_bloc |
| HTTP Client | dio |
| Local Storage | shared_preferences |
| Geocoding | geocoding |
| Code Generation | freezed + json_serializable |
| Weather Data | WeatherAPI |
| Air Quality Data | WAQI |
| Auth API | EscuelaJS |
The project follows a layered architecture separating data access, state, and UI concerns:
ββββββββββββββββββββββββββββββββββββ
β UI Layer β
β (page/ β screens & widgets) β
ββββββββββββββββ¬ββββββββββββββββββββ
β
ββββββββββββββββΌββββββββββββββββββββ
β State Layer β
β (providers/ + flutter_bloc) β
ββββββββββββββββ¬ββββββββββββββββββββ
β
ββββββββββββββββΌββββββββββββββββββββ
β Data Layer β
β api/ Β· models/ Β· storage/ β
ββββββββββββββββ¬ββββββββββββββββββββ
β
ββββββββββββ΄βββββββββββ
βΌ βΌ
WeatherAPI WAQI
(weather + forecast) (air quality)
api/β Remote service calls (WeatherAPI, WAQI, auth)models/β Typed data models, generated withfreezedandjson_serializablestorage/β Local persistence for tokens and cached weather dataproviders/β Lightweight app-level state usingproviderpage/β All screens and UI modules
weather_app/
βββ lib/
β βββ api/ # Remote API service classes
β βββ models/ # Dart data models (freezed/json)
β βββ page/
β β βββ aqi_scale/ # AQI scale reference screen
β β βββ data_bank/ # Data request form UI
β β βββ home/ # Home dashboard screen
β β βββ location_details/ # Detailed AQ + weather view
β β βββ login.dart # Login screen
β β βββ more.dart # Profile / settings menu
β β βββ on_boarding.dart # Onboarding slides
β β βββ root_page.dart # Bottom nav shell
β βββ providers/ # Provider-based app state
β βββ storage/ # SharedPreferences helpers
β βββ main.dart # App entry point
βββ assets/ # Images, icons, static files
βββ android/
βββ ios/
βββ linux/
βββ macos/
βββ web/
βββ windows/
βββ test/
βββ pubspec.yaml
βββ README.md
Used to fetch current weather conditions, hourly forecasts, and 7-day weather forecasts based on location.
Used to fetch real-time AQI data and individual pollutant readings including Oβ, PM10, NOβ, PM2.5, SOβ, and CO.
Reverse geocoding via the geocoding package resolves human-readable street and location names from device coordinates.
Login and token management is handled via the EscuelaJS public API.
β οΈ API keys and tokens are currently configured directly in the source code. Ensure valid credentials are in place before running the app against live services.
The app persists the following data locally using shared_preferences:
| Key | Contents |
|---|---|
| Access token | JWT access token from login |
| Refresh token | JWT refresh token |
| Cached weather | Latest weather response for the default location |
Cached weather data is used on the Home screen when fresh data is unavailable.
The project uses two complementary state management approaches:
providerβ Lightweight app-level state such as auth status and shared UI stateflutter_blocβ Bloc/Cubit pattern for more structured state in specific screens
Not every screen is fully wired to Bloc in the current implementation; some screens use Provider or local state directly.
Multi-slide introduction to the app. Messaging covers breathing better, tracking air pollution, and managing exposure. Leads to the login screen.
Email and password form with validation. On success, navigates to the main app shell. Auth tokens are stored locally.
Displays current weather conditions and AQI for the current location. Shows a short forecast UI. Uses cached data when available and navigates to Location Details for a deeper view.
Note: The current implementation uses a default city configured in code.
The most data-dense screen. Shows:
- Current weather
- Pollutant breakdown: Oβ, PM10, NOβ, PM2.5, SOβ, CO
- Hourly weather timeline
- 7-day air quality forecast
- 7-day weather forecast
- Recommendation cards generated from live weather and AQ data
Informational screen explaining AQI value ranges and their associated health categories.
Form-based UI for data requests. Current implementation is primarily UI-driven and routes to location detail views.
Profile and settings menu with the following items:
- Profile
- Saved Location
- FAQ
- Settings
- About Us
- Contact Us
- Logout
- Flutter SDK (stable channel recommended)
- Dart (included with Flutter)
- Android Studio, VS Code, or another Flutter-compatible IDE
- A connected device or emulator
# Clone the repository
git clone https://github.com/DangHuuLong/Weather-App.git
cd Weather-App
# Install dependencies
flutter pub getflutter runTo generate code for freezed and json_serializable models:
dart run build_runner build --delete-conflicting-outputs- The Home screen uses a default city value hard-coded in source. Dynamic location-based fetching may require additional permission and GPS configuration.
- API keys for WeatherAPI and WAQI are currently embedded in the source code. For any fork or deployment, replace these with your own valid credentials.
- The Data Bank screen is primarily UI-driven in the current state; a full backend data request flow has not been confirmed.
- Some More menu items (e.g. Saved Location, Settings, About Us) may be partially implemented.
- The project integrates both
providerandflutter_bloc; state management coverage varies across screens. - Live data depends on active and valid API subscriptions to WeatherAPI and WAQI.
Built with β€οΈ by DangHuuLong using Flutter & Dart
Repository