This is a simple weather forecaster that uses the OpenWeatherMap API to get the weather forecast for a given city. The user can input the city name to search from a predefined list of cities. Clicking on a city will display the weather forecast for the next 5 days.
- View Current Weather: View the current weather for a given city, including minimum and maximum temperatures.
- 5-day forecast: View the weather forecast for the next 5 days.
- Ensure you have Flutter installed on your machine.
- You will need an API key from OpenWeatherMap to access the weather data.
-
Clone the Repository
First, clone this repository to your local machine using Git.
git clone https://github.com/Lord-Chris/weather-forecaster.git cd weather-forecaster
-
Install Dependencies
Navigate to the project directory and run the following command to install the necessary Flutter dependencies:
flutter pub get
-
Run the App
Ensure an emulator is running or a device is connected to your computer. You can check connected devices with:
flutter devices
Then, execute the following command to run the app:
flutter run --dart-define=OPEN_WEATHER_API_KEY=${API_KEY}
-
Select a City
Click on the search bar to select a city from the list of predefined cities.
-
View Weather Forecast
Click on a city to view the weather forecast for the next 5 days.
-
Refresh Data
Pull down the screen to refresh the weather data.
Execute the following command to run the tests:
flutter test
To generate a coverage report, run the following command:
flutter test --coverage
The coverage report will be generated in the coverage
directory.
Truth can only be found in one place: the code.
-- Robert C. Martin
... and Assurance can be found in one place: the tests.
-- LordChris