weather 0.0.8 weather: ^0.0.8 copied to clipboard
A weather plugin for fetching current weather and forecasting via the OpenWeatherMap API. Works for both Android and iOS.
weather #
Install #
Add weather
as a dependency in pubspec.yaml
.
For help on adding as a dependency, view the documentation.
Permissions #
The plugin uses your location to fetch weather data, therefore location tracking must be enabled.
Android #
Add the following entry to your manifest.xml
file, in the Android project of your application:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
In addition, it is recommended to set your minimum SDK version to 21.
iOS #
- Open the XCode project of your app, named
Runner.xcodeproj
- Locate the
info.plist
file in theRunner
directory. - Right click
info.plist
and chooseOpen as > Source Code
. - Add the following entries inside the
<dict></dict>
tags`:
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app uses location to forecast the weather.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>This app uses location to forecast the weather.</string>
Known issues
There is an issue with the location
plugin which this plugin depends on, where an error with the following message
The use of Swift 3 @objc inference in Swift 4 mode is deprecated
may be thrown. For a solution, check the following stack overflow question: https://stackoverflow.com/questions/44379348/the-use-of-swift-3-objc-inference-in-swift-4-mode-is-deprecated
Usage #
First and foremost you need an API key from OpenWeatherMap, which can be acquired for free here.
WeatherStation ws = WeatherStation("YOUR_API_KEY");
Query current weather #
For api documentation on the current weather API, see the documentation.
Weather weather = await ws.getCurrentWeather();
Query 5 day forecast #
For api documentation on the forecast API, see the documentation.
<<<<<<< Updated upstream
Map<String, dynamic> forecastJSON = await weather.getFiveDayForecast();
======= List
>>>>>>> Stashed changes
# weather
[![pub package](https://img.shields.io/pub/v/weather.svg)](https://pub.dartlang.org/packages/weather)
## Install
Add ```weather``` as a dependency in `pubspec.yaml`.
For help on adding as a dependency, view the [documentation](https://flutter.io/using-packages/).
## Permissions
The plugin uses your location to fetch weather data, therefore location tracking must be enabled.
### Android
Add the following entry to your `manifest.xml` file, in the Android project of your application:
```xml
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
In addition, it is recommended to set your minimum SDK version to 21.
iOS #
- Open the XCode project of your app, named
Runner.xcodeproj
- Locate the
info.plist
file in theRunner
directory. - Right click
info.plist
and chooseOpen as > Source Code
. - Add the following entries inside the
<dict></dict>
tags`:
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app uses location to forecast the weather.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>This app uses location to forecast the weather.</string>
Known issues
There is an issue with the location
plugin which this plugin depends on, where an error with the following message
The use of Swift 3 @objc inference in Swift 4 mode is deprecated
may be thrown. For a solution, check the following stack overflow question: https://stackoverflow.com/questions/44379348/the-use-of-swift-3-objc-inference-in-swift-4-mode-is-deprecated
Usage #
First and foremost you need an API key from OpenWeatherMap, which can be acquired for free here.
WeatherStation ws = WeatherStation("YOUR_API_KEY");
Query current weather #
For api documentation on the current weather API, see the documentation.
Weather weather = await ws.getCurrentWeather();
Query 5 day forecast #
For api documentation on the forecast API, see the documentation.
<<<<<<< Updated upstream
Map<String, dynamic> forecastJSON = await weather.getFiveDayForecast();
======= List
>>>>>>> Stashed changes
# weather
[![pub package](https://img.shields.io/pub/v/weather.svg)](https://pub.dartlang.org/packages/weather)
## Install
Add ```weather``` as a dependency in `pubspec.yaml`.
For help on adding as a dependency, view the [documentation](https://flutter.io/using-packages/).
## Permissions
The plugin uses your location to fetch weather data, therefore location tracking must be enabled.
### Android
Add the following entry to your `manifest.xml` file, in the Android project of your application:
```xml
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
In addition, it is recommended to set your minimum SDK version to 21.
iOS #
- Open the XCode project of your app, named
Runner.xcodeproj
- Locate the
info.plist
file in theRunner
directory. - Right click
info.plist
and chooseOpen as > Source Code
. - Add the following entries inside the
<dict></dict>
tags`:
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app uses location to forecast the weather.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>This app uses location to forecast the weather.</string>
Known issues
There is an issue with the location
plugin which this plugin depends on, where an error with the following message
The use of Swift 3 @objc inference in Swift 4 mode is deprecated
may be thrown. For a solution, check the following stack overflow question: https://stackoverflow.com/questions/44379348/the-use-of-swift-3-objc-inference-in-swift-4-mode-is-deprecated
Usage #
First and foremost you need an API key from OpenWeatherMap, which can be acquired for free here.
WeatherStation ws = WeatherStation("YOUR_API_KEY");
Query current weather #
For api documentation on the current weather API, see the documentation.
Weather weather = await ws.getCurrentWeather();
Query 5 day forecast #
For api documentation on the forecast API, see the documentation.
<<<<<<< Updated upstream
Map<String, dynamic> forecastJSON = await weather.getFiveDayForecast();
======= List
>>>>>>> Stashed changes