Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flutter Weather App Banner

🌦 Flutter Weather App

A modern Flutter application that provides real-time weather information using your current location or city search.

Flutter Dart License


🌤 Weather

A real-time weather monitoring Flutter app powered by the Open-Meteo API — no API key required. Features live weather data, small-town search (including Bangladeshi upazilas), animated weather icons, and a modern dark UI.


📸 Features

Feature Details
🌍 Live weather Fetches real data from Open-Meteo (free, no signup)
📍 GPS auto-detect Detects your location on launch
🔍 City search Searches cities, districts, and upazilas worldwide
🇧🇩 Bangladesh support Finds small towns and upazilas by name
🕐 24-hour forecast Scrollable hourly temperature + rain %
📅 7-day forecast Daily high/low with visual temperature bar
📊 Conditions panel Humidity, UV index, pressure, wind, visibility, feels-like
🌡 °C / °F toggle Converts all temperatures instantly
🔄 Pull to refresh Swipe down to re-fetch live data
🎨 Animated icons Custom-drawn sun, moon, clouds, rain, snow, storm
🌌 Ambient background Dynamic gradient that shifts with weather type

📸 Screenshots


🗂 Project Structure

lib/
├── main.dart                      # App entry point (~20 lines)
│
├── models/
│   └── weather_model.dart         # WeatherModel, HourlyPoint, DailyPoint, GeoResult
│
├── services/
│   └── weather_service.dart       # All API calls: weather fetch, city search, GPS
│
├── theme/
│   └── colors.dart                # App-wide color palette (class C)
│
├── painters/
│   └── weather_painter.dart       # Custom weather icons + animated background
│
├── widgets/
│   ├── hero_card.dart             # Main temperature display card
│   ├── hourly_strip.dart          # Horizontal 24-hour forecast
│   ├── daily_forecast.dart        # 7-day forecast list
│   ├── metrics_grid.dart          # 2×3 conditions grid
│   └── search_bar_widget.dart     # Search input + results list
│
└── pages/
    └── home_page.dart             # Main page: state, animations, layout

🚀 Getting Started

Prerequisites

  • Flutter SDK >=3.0.0
  • Dart SDK >=3.0.0
  • An internet connection (for live weather data)

Check your Flutter version:

flutter --version

Step 1 — Create a new Flutter project

flutter create nimbus_weather
cd nimbus_weather

Step 2 — Replace the lib/ folder

Delete the generated lib/main.dart and copy all downloaded files into lib/, preserving the folder structure:

nimbus_weather/
├── lib/
│   ├── main.dart
│   ├── models/
│   │   └── weather_model.dart
│   ├── services/
│   │   └── weather_service.dart
│   ├── theme/
│   │   └── colors.dart
│   ├── painters/
│   │   └── weather_painter.dart
│   ├── widgets/
│   │   ├── hero_card.dart
│   │   ├── hourly_strip.dart
│   │   ├── daily_forecast.dart
│   │   ├── metrics_grid.dart
│   │   └── search_bar_widget.dart
│   └── pages/
│       └── home_page.dart
├── pubspec.yaml                   ← replace this too
└── ...

Step 3 — Add Android permissions

Open android/app/src/main/AndroidManifest.xml and add these lines before the <application tag:

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

Windows and Chrome do not need any extra permission changes.


Step 4 — Run the app

# Windows desktop
flutter run -d windows

# Chrome browser
flutter run -d chrome

# Android device (connect via USB first)
flutter run -d android

To choose from connected devices interactively:

flutter run

🔍 City & Upazila Search

The search fires two parallel requests — English and Bengali — then merges results. This lets you find:

  • Major cities: Dhaka, Chittagong, Sylhet
  • Districts: Gazipur, Narsingdi, Comilla

Each result shows the full location path, for example:

Savar
Savar, Dhaka District, Dhaka Division, Bangladesh

🌐 API Reference

API URL Cost
Weather data https://api.open-meteo.com/v1/forecast Free, no key
City/upazila search https://geocoding-api.open-meteo.com/v1/search Free, no key

No account or API key is needed. The app works immediately out of the box.

Weather variables fetched

Current: temperature, feels-like, humidity, weather code, wind speed & direction, UV index, precipitation, pressure, visibility, is_day

Hourly (24h): temperature, weather code, precipitation probability

Daily (7 days): max/min temperature, weather code, precipitation sum, UV max, wind max


🎨 Design System

All colors live in lib/theme/colors.dart under the C class:

Token Hex Usage
C.bg #07111F App background
C.card #0D1E33 Card backgrounds
C.accent #4EADFF Primary accent, highlights
C.gold #FFCC55 Sun, high temp, UV
C.rain #70C8FF Rain, precipitation
C.storm #AA88FF Storm, wind
C.green #3DDBA0 Pressure indicator
C.txt #EAF2FF Primary text
C.txtSub #6E9BBF Secondary / label text

To retheme the app, edit only this one file.


🧩 Dependencies

Package Version Purpose
http ^1.2.0 HTTP requests to Open-Meteo API
geolocator ^11.0.0 GPS location detection
permission_handler ^11.3.0 Runtime location permission
intl ^0.19.0 Time and date formatting
cupertino_icons ^1.0.6 iOS-style icons

Contact

Email: 2001031@iot.uftb.ac.bd


📄 License

This project is open source and free to use. Weather data provided by Open-Meteo under the CC BY 4.0 license.

About

A simple Flutter weather application that provides real-time weather information using the user's current location or city search with a clean and responsive interface.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages