Flutter Weather Forecast App
Build a Flutter weather app that shows the current conditions and a 5-day forecast for your city, with icons, a temperature chart, a switch between Celsius and Fahrenheit, city search and pull-to-refresh. Data comes from the free Open-Meteo API (no key needed) through the http package, and app state is managed with Provider: a ChangeNotifier keeps track of loading, errors and data, so screens simply react to it. The app handles being offline gracefully by showing the last forecast it loaded. You'll learn making HTTP requests and parsing JSON, Dart model classes, Provider and ChangeNotifier, building screens with lists and charts, and designing loading and error states.
- Estimate
- ~10h
- Steps
- 7
- Completed by
- 0
- Proposed by
- codeseed.app
Flutter · http · Provider · Open-Meteo
Project roadmap
- 01
Try the weather API
~1hOpen the Open-Meteo geocoding and forecast APIs in the browser for your city, and note the fields you need (current temperature, weather code, wind, and daily highs, lows and codes). Create the Flutter project, add http and provider, and make a first request from a test to print the current temperature. Done when: the test prints the current temperature for a city.
- 02
Model the JSON
~1.5hWrite Dart classes (City, CurrentWeather and DailyForecast) with fromJson factories, turning Open-Meteo's parallel arrays into lists of daily objects and parsing dates. Map weather codes to a description and an icon. Write unit tests with saved JSON responses. Done when: the tests turn sample responses into correct objects.
- 03
Build the Provider state
~1.5hCreate a WeatherProvider extending ChangeNotifier with the state (loading, error message, current city, current weather and forecast) and methods to load a city's weather and change units, calling notifyListeners after each change. Put the API calls in a separate WeatherService passed to the provider, so tests can replace it. Done when: the provider loads data and exposes loading and error states.
- 04
Build the current weather screen
~1.5hBuild the main screen with Consumer or context.watch: the city, a large temperature, the description and icon, wind and humidity, and a Celsius and Fahrenheit toggle that converts the values shown. Show a spinner while loading and an error message with Retry on failure. Done when: the screen shows the current weather and reacts to the unit toggle.
- 05
Add the forecast
~1.5hAdd a list of the next 5 days with the weekday, icon, high and low, and a simple temperature chart (for example with the fl_chart package). Add pull-to-refresh with RefreshIndicator. Done when: the forecast list and chart show correct data, and pulling down refreshes it.
- 06
Add search and offline support
~1.5hAdd a city search screen using the geocoding API, and remember the last chosen city and the last loaded forecast with shared_preferences. When a request fails because there's no connection, show the saved forecast with a note of when it was loaded. Done when: searching changes the city, and in airplane mode the app shows the last forecast with a note.
- 07
Test it
~1.5hWrite unit tests for the provider with a fake service (loading, success, error and unit changes) and widget tests for the main screen's loading, error and data states. Done when: flutter test passes without internet access.
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack