Skip to content

This Weather App is a Flutter-based application that provides users with real-time weather information and a 5-day forecast for their current location or any specified city. Built using Flutter's modern framework, the app leverages state management through the Provider package, ensuring efficient data handling and UI updates.

Notifications You must be signed in to change notification settings

trishna456/weather-app

Repository files navigation

Weather App

A Flutter-based Weather App that provides real-time weather information and a 5-day forecast based on the user's location or a specified city. This app is built using the Provider state management solution, ensuring smooth and efficient updates across the UI.

Features

  • Real-Time Weather Data: Displays current temperature, weather condition, and additional weather details like humidity, wind speed, and atmospheric pressure.
  • 5-Day Forecast: Detailed 5-day weather forecast, including min/max temperatures and weather conditions.
  • Dynamic Units Toggle: Switch between metric and imperial units for temperature and wind speed.
  • Responsive Design: Adapts seamlessly across various screen sizes, from mobile devices to large desktop screens, with dynamic margins and paddings.
  • Error Handling: User-friendly error message with animation when weather data fails to load.
  • Loading State: Loading indicator displayed while fetching weather data.

Screenshots

Mobile Screenshots

Mobile Screenshot 1 Mobile Screenshot 2 Mobile Screenshot 3 Mobile Screenshot 4

Web Screenshots

Web Screenshot 1 Web Screenshot 2 Web Screenshot 3 Web Screenshot 4 Web Screenshot 5

Technologies Used

  • Flutter: Framework for building the UI.
  • Provider: State management for managing and updating the app's state.
  • Lottie: For engaging animations in error and loading states.
  • REST API Integration: Retrieves weather data from a third-party weather service API.

Getting Started

Prerequisites

  • Flutter SDK installed on your local machine.

Installation

  1. Clone the repository:

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

    cd weather-app
  3. Install dependencies:

    flutter pub get

Running the App

On Mobile:

flutter run

On Web

flutter run -d chrome

Project Structure

lib/
├── models/       # Contains data models for the weather data
├── services/     # Contains services for fetching weather data from APIs
├── state/        # Contains the WeatherState class for managing app state with Provider
├── widgets/      # Contains reusable UI components like input fields, weather info displays, and forecast lists
└── pages/        # Contains the main page of the app

Code References

This project draws on a select number of key resources, incorporating techniques and ideas from a few trusted sources, including contributions from the community on Stack Overflow, official Flutter documentation, official Flutter YouTube channel, and free resources from LottieFiles. Below are the primary references:

1. Weather App Design

  • References:
  • Usage: The design ideas for the weather app were inspired by exploring multiple designs on Dribbble and drawing inspiration from Apple's iOS weather app.

2. Class Constructors

3. State Management with Provider

  • Reference: Simple App State Management (Flutter Documentation)
  • Usage: Helpful in implementing state management using the Provider package.

4. Date Utility Functions

  • Reference: How do I format a date with Dart? (Stack Overflow)
  • Usage: This thread provided a clear and concise method for formatting dates in Dart using DateFormat.

5. Error Resolution

6. Lottie Animations

7. Flutter Tutorials

  • Flutter YouTube Channel: Flutter Dev on YouTube (Flutter YouTube Channel)
  • Usage: Guided the development process, particularly in understanding the Flutter's UI components and best practices.

Contributions

Contributions are welcome! If you have ideas for improvements or bug fixes, feel free to submit a pull request or open an issue.

About

This Weather App is a Flutter-based application that provides users with real-time weather information and a 5-day forecast for their current location or any specified city. Built using Flutter's modern framework, the app leverages state management through the Provider package, ensuring efficient data handling and UI updates.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published