- Real-time Weather Data: Displays the current weather conditions based on your location.
- Hourly and Daily Forecasts: Get detailed weather forecasts for the upcoming hours and days.
- Location-Based Weather: Automatically fetches weather data based on the user's location using GPS.
- Clean and Simple UI: User-friendly interface with clear weather information.
- Multi-Language Support: Adapts to device language (Arabic/English).
Home Screen (Arabic) | Home Screen (English) |
---|---|
Before you begin, ensure you have met the following requirements:
- Flutter SDK installed: Install Flutter
- A free API key from Here to get weather data.
-
Clone the repository:
git clone https://github.com/AhmedAlboishe/weather-app.git
-
Navigate to the project directory:
cd weather-app
-
Install the dependencies:
flutter pub get
-
Run the application:
flutter run
To run the app, you'll need an API key from https://www.weatherapi.com. Follow these steps to add your API key:
-
Sign up on https://www.weatherapi.com and obtain your API key.
-
Open the
lib/core/services/weather_services.dart
file in the project. -
Replace
YOUR_API_KEY
with your actual API key:const String apiKey = 'YOUR_API_KEY';
-
Save the file and restart the application.
The app requires location access to fetch weather data based on the user's current location. Make sure you handle the following permissions:
- Android: Ensure location permission is declared in AndroidManifest.xml.
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
- iOS: Make sure the Info.plist file contains the required location permission settings.
<key>NSLocationWhenInUseUsageDescription</key>
<string>We need your location to provide weather updates.</string>
The application fetches weather data based on the user's current location. It uses the following components:
- Geolocator: To obtain the user's current location.
- WeatherAPI: To retrieve real-time weather data such as temperature, wind speed, and weather conditions for the location.
- UI Components: A simple and intuitive interface to display the weather information, including hourly and daily forecasts.
This weather application relies entirely on location services to provide accurate weather data based on the user's current location. Manual search for locations is not supported, so granting location permission is essential for the app to function properly.
If the user denies location permissions, they will be prompted to enable location access from their device settings. Without location access, the app cannot retrieve or display weather data.
- get.
- geolocator.
- chart_sparkline.
- permission_handler.
- intl.
- gap.
- lottie.
- flutter_svg.