Skip to content

Latest commit

 

History

History
90 lines (57 loc) · 2.94 KB

README.md

File metadata and controls

90 lines (57 loc) · 2.94 KB

Weather App

A Flutter weather application that fetches weather data from the OpenWeather API using Dio.

Features

  • Search for cities to get current weather data
  • Display previously searched cities
  • Save and retrieve previously searched cities using SharedPreferences
  • Display weather details for a specific city in the DetailsScreen

Screens

  • HomeScreen: The main screen displaying the current weather and previously searched cities.
  • SearchScreen: A screen that allows the user to search for cities.
  • DetailsScreen: A screen that displays detailed weather information for a selected city.
HomeScreen SearchScreen DetailsScreen
1720287695751_100 1720287731403_100 1720287672375_100

Providers

  • CityProvider: Manages city search results and stores previously searched cities.
  • WeatherProvider: Manages weather data fetching and storage.

Getting Started

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/weather_app.git
  2. Navigate to the project directory:

    cd weather_app
  3. Get the dependencies:

    flutter pub get

Running the App

  1. Connect your device or start an emulator.

  2. Run the app:

    flutter run

Usage

  1. On the HomeScreen, you can view the current weather and a list of previously searched cities.
  2. Navigate to the SearchScreen by tapping the search icon.
  3. On the SearchScreen, enter a city name to search for weather data.
  4. Select a city from the search results to view detailed weather information on the DetailsScreen.

Dependencies

API Key

This project uses the OpenWeather API. You need to replace YOUR_API_KEY in the CityService class with your actual OpenWeather API key.

final String _apiKey = "YOUR_API_KEY";

License

This project is licensed under the MIT License - see the LICENSE file for details.

Make sure to replace YOUR_API_KEY with your actual OpenWeather API key and the GitHub repository URL with the actual URL of your repository.