weather 0.0.4 weather: ^0.0.4 copied to clipboard
A weather plugin using the OpenWeatherMap API.
weather #
Install #
Add weather
as a dependency in pubspec.yaml
.
For help on adding as a dependency, view the documentation.
Usage #
First and foremost you need an API key from OpenWeatherMap, which can be acquired for free here.
String key = 'YOUR_API KEY';
Weather weather = new Weather(key);
Query current weather #
For api documentation on the current weather API, see the documentation.
Map<String, dynamic> weatherJSON = await weather.getCurrentWeather();
Query 5 day forecast #
For api documentation on the forecast API, see the documentation.
Map<String, dynamic> forecastJSON = await weather.getFiveDayForecast();