A modern, cross-platform weather application built with Flutter that delivers real-time weather data by leveraging device location and a third-party API.
This project focuses on clean UI design, accurate data fetching, and robust API handling, with full support for web deployment.
- Location-Based Weather: Automatically detects the user's current location to fetch and display accurate local weather.
- Real-Time Data: Retrieves up-to-the-minute weather conditions, temperature, humidity, wind speed, and more.
- Dynamic UI: The application interface is designed with a modern aesthetic and features online images and icons that dynamically change based on the current weather condition.
- Web Support: Fully functional and optimized for deployment as a web application.
- Cross-Platform Ready: Built with Flutter, making it easily adaptable for Android and iOS mobile platforms.
| Component | Technology | Role |
|---|---|---|
| Framework | Flutter / Dart | Frontend development and UI rendering. |
| Weather Data | OpenWeatherMap API | Source for current weather data and forecasts. |
| Location | Geolocator Package | Handles device location permission and retrieval of coordinates (Latitude/Longitude). |
| Data Handling | http Package |
Used for making asynchronous GET requests to the OpenWeatherMap API. |
To run this project locally, you must have the Flutter SDK installed and configured.
- Flutter SDK: Ensure you have the latest stable version installed.
- OpenWeatherMap API Key:
- Sign up for a free account at OpenWeatherMap.
- Generate and obtain your unique API Key (APPID).
-
Clone the Repository:
git clone [https://github.com/KarthikeyanS2006/weather_app.git](https://github.com/KarthikeyanS2006/weather_app.git) cd weather_app -
Install Dependencies:
flutter pub get
-
Set Your API Key (Crucial Step):
- Find the configuration file where the API key is used (usually in a
constants.dartorapi_service.dartfile). - Replace the placeholder with your actual OpenWeatherMap API Key.
⚠️ Security Note: Never commit your actual API key directly to a public repository. Use environment variables for production projects. - Find the configuration file where the API key is used (usually in a
-
Run the Application (Web/Mobile):
- For Web (Desktop testing):
flutter run -d chrome
- For Mobile (Emulator/Device):
flutter run
- For Web (Desktop testing):
The first time you run the app, it will prompt you for location permission. You must grant access for the app to function correctly.
- Android: Ensure location services are enabled on your emulator/device.
- Web: The browser will prompt you for location access.
- Implement a 5-day / 3-hour Forecast View.
- Add a City Search feature as an alternative to location detection.
- Use a State Management solution (like Provider, Riverpod, or Bloc) for better application architecture.
- Implement a responsive design that adapts seamlessly to all mobile screen sizes.