A weather application using the Flutter Framework by Google. All Weather Data is fetched from the OpenWeatherMap API with different subscription options available depending on project requirements.
To run this project, you will need to add the following environment variables to your .env file
API_KEY
This 'API_KEY' is supplied by OpenWeatherMap API for both free and paid account types.
| Package Name | Version | Description |
|---|---|---|
cupertino_icons |
^1.0.2 |
Default set of icon assets used by Flutter's Cupertino widgets. |
geocoding |
^1.0.5 |
Retrieve address from lat and lon. |
geolocator |
^6.1.1 |
Retrieve lat and lon from device location. (Permissions Required) |
intl |
^0.17.0 |
Provides internationalization and localization. |
get |
^4.1.4 |
State & Route Management. |
http |
^0.13.3 |
Future-based library for making HTTP requests. |
flutter_dotenv |
^5.0.0 |
Load configuration at runtime from a .env file. |
pull_to_refresh |
^2.0.0 |
Refresh ListView Widgets with pull down. |
get_storage |
^2.0.2 |
A fast, light and synchronous key-value in memory, which backs up data to disk at each operation. |
I chose to subscribe to the 'One Call API'. The API calls below are specific to that subscription with the path /onecall?. If you choose a different subscription, just note that your call may be different.
GET https://api.openweathermap.org/data/2.5/onecall?lat={lat}&lon={lon}&appid={API key}| Parameter | Type | Description |
|---|---|---|
lat |
string |
Required. Latitude Position |
lat |
string |
Required. Longitude Position |
api_key |
string |
Required. Your API key |
GET https://api.openweathermap.org/data/2.5/onecall?lat={lat}&lon={lon}&units={units}&appid={API key}| Parameter | Type | Description |
|---|---|---|
lat |
string |
Required. Latitude Position |
lat |
string |
Required. Longitude Position |
units |
string |
Units (Standard, Imperial, Metric) |
api_key |
string |
Required. Your API key |
GET https://api.openweathermap.org/data/2.5/onecall?lat={lat}&lon={lon}&exclude={parts}&units={units}&appid={API key}| Parameter | Type | Description |
|---|---|---|
lat |
string |
Required. Latitude Position |
lat |
string |
Required. Longitude Position |
exclude |
list |
List of data to be omitted from response |
units |
string |
Units (Standard, Imperial, Metric) |
api_key |
string |
Required. Your API key |
Note:
unitsparameter should be a comma seperated list without spaces. Possible list values are:
currentminutelyhourlydailyalerts
Clone the project
$ git clone https://github.com/bmteasdale/weatherapp.gitGo to the project directory
$ cd weatherappInstall dependencies
$ flutter pub getRun application after opening a mobile simulator
$ flutter run