A clean and minimal Flutter weather application that fetches real-time weather data using the OpenWeatherMap API. Search any city to instantly view temperature, humidity, wind speed, sunrise/sunset times, and animated weather conditions.
09.05.2026_22.29.16_REC.mp4
- 🔍 Search weather by city name
- 🌡️ Real-time temperature in °C
- 💧 Humidity and 💨 wind speed display
- 🌅 Sunrise & sunset times
- 🎨 Dynamic gradient background based on weather condition
- 🎞️ Lottie animations for rain, sunny, and cloudy conditions
- ⚡ Loading indicator while fetching data
| Layer | Technology |
|---|---|
| Framework | Flutter |
| Language | Dart |
| Weather API | OpenWeatherMap |
| HTTP Client | http package |
| Animations | lottie package |
| Date Formatting | intl package |
lib/
├── main.dart # App entry point
├── models/
│ └── weather_model.dart # Weather data model
├── services/
│ └── weather_service.dart # API calls
├── screens/
│ └── home_screen.dart # Main screen UI
└── widgets/
└── weather_card.dart # Weather display card
assets/
├── rain.json # Lottie animation
├── sunny.json # Lottie animation
└── cloudy.json # Lottie animation
- Flutter SDK (3.x or later)
- An OpenWeatherMap API key (free tier works)
- Android Studio / VS Code with Flutter extension
-
Clone the repository
git clone https://github.com/Monam1083/Weather-Mobile-Application cd Weather-Mobile-Application -
Install dependencies
flutter pub get
-
Add your API key
Open
lib/services/weather_service.dartand replace the placeholder:final String apikey = "YOUR_API_KEY_HERE";
-
Add Lottie animation assets
Place your
.jsonLottie files in theassets/folder and ensurepubspec.yamlincludes:flutter: assets: - assets/rain.json - assets/sunny.json - assets/cloudy.json
-
Run the app
flutter run
Add these to your pubspec.yaml:
dependencies:
flutter:
sdk: flutter
http: ^1.2.0
lottie: ^3.0.0
intl: ^0.19.0This app uses the OpenWeatherMap Current Weather API:
GET https://api.openweathermap.org/data/2.5/weather?q={city}&appid={apikey}
| Field Used | Source in JSON |
|---|---|
| City Name | json["name"] |
| Temperature | json["main"]["temp"] (converted from Kelvin) |
| Description | json["weather"][0]["description"] |
| Humidity | json["main"]["humidity"] |
| Wind Speed | json["wind"]["speed"] |
| Sunrise | json["sys"]["sunrise"] |
| Sunset | json["sys"]["sunset"] |
# Debug build
flutter build apk
# Release build
flutter build apk --release
# Split by ABI (smaller size)
flutter build apk --split-per-abiOutput: build/app/outputs/flutter-apk/app-release.apk
Pull requests are welcome! For major changes, please open an issue first to discuss what you'd like to change.
- OpenWeatherMap for the free weather API
- LottieFiles for animation assets
- Flutter team for the amazing framework