Skip to content

AhmedAlboishe/weather-app

Repository files navigation

Weather App 🌤️

A Flutter-based weather application that provides real-time weather information using WeatherAPI.

Features ✨

  • 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).

Screenshots 📱

Home Screen (Arabic) Home Screen (English)

Getting Started 🚀

Prerequisites

Before you begin, ensure you have met the following requirements:

Installation

  1. Clone the repository:

    git clone https://github.com/AhmedAlboishe/weather-app.git
  2. Navigate to the project directory:

    cd weather-app
  3. Install the dependencies:

    flutter pub get
  4. Run the application:

    flutter run

Environment Setup

To run the app, you'll need an API key from https://www.weatherapi.com. Follow these steps to add your API key:

  1. Sign up on https://www.weatherapi.com and obtain your API key.

  2. Open the lib/core/services/weather_services.dart file in the project.

  3. Replace YOUR_API_KEY with your actual API key:

    const String apiKey = 'YOUR_API_KEY';
  4. Save the file and restart the application.

Permissions

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>

How It Works 🔍

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.

Permissions

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.

Packages Used 🛠️

  • get.
  • geolocator.
  • chart_sparkline.
  • permission_handler.
  • intl.
  • gap.
  • lottie.
  • flutter_svg.

About

A very simple weather app with a modern design

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published