A weather application that provides current weather information and 5-day forecasts with offline support.
- Current Weather Display: View detailed current weather information including temperature, conditions, humidity, and wind speed
- 5-Day Forecast: Access a 5-day weather forecast for your selected city
- City Search: Search for weather information in any city worldwide
- Offline Support: Access previously loaded weather data even without an internet connection
- Auto-Refresh: Weather data automatically updates to ensure accuracy
- Cached Cities: Quick access to recently searched cities
- Material Design: Clean and modern user interface following Material Design principles
- Dark Mode Support: Automatic theme switching based on system preferences
- BLoC Pattern: State management using Flutter BLoC for clean architecture
- API Integration: Weather data fetched from OpenWeather API
- Local Storage: Offline data persistence using Hive
- Connectivity Handling: Automatic handling of online/offline states
- Error Handling: Comprehensive error handling with user-friendly messages
- Hydrated BLoC: Persistent state management
- Responsive Design: Adapts to different screen sizes
- Flutter SDK (latest version)
- Dart SDK (latest version)
- OpenWeather API key
- Clone the repository:
git clone https://github.com/yourusername/weather_app.git- Navigate to the project directory:
cd weather_app- Install dependencies:
flutter pub get-
Copy
.env.exampleto.env -
Replace
your_api_key_herewith your actual OpenWeather API key -
Run the app:
flutter runlib/
├── blocs/ # BLoC state management
│ ├── connectivity/ # Network connectivity management
│ └── weather/ # Weather data management
├── data/
│ ├── api/ # API services
│ ├── models/ # Data models
│ ├── providers/ # Local storage providers
│ └── repositories/ # Data repositories
└── ui/
├── screens/ # App screens
└── widgets/ # Reusable widgets
flutter_bloc: State managementhydrated_bloc: Persistent state managementconnectivity_plus: Network connectivity detectionhive: Local data storagechopper: API clientequatable: Value equalityintl: Internationalization and formattingflex_color_scheme: Theming