Air Quality Index #
Collects air quality index from the World's Air Quality Index service.
No permissions needed.
The location package is also needed for the AirQuality package.
An API key is needed in order to perform queries. An API key is obtained here: https://aqicn.org/api/
String key = 'XXX38456b2b85c92647d8b65090e29f957638c77'; AirQuality airQuality = new AirQuality(key);
Air Quality Feed Examples #
/// Via city name (Munich) AirQualityData feedFromCity = await airQuality.feedFromCity('munich'); /// Via station ID (Gothenburg weather station) AirQualityData feedFromStationId = await airQuality.feedFromStationId('7867'); /// Via Geo Location (Berlin) AirQualityData feedFromGeoLocation = await airQuality.feedFromGeoLocation('52.6794', '12.5346'); /// Via IP (depends on service provider) AirQualityData fromIP = await airQuality.feedFromIP();
- Released as a Flutter package (rather than a plugin).
- No longer depends on an external location package.
- Now supports both city name queries as well as Location queries.
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: air_quality: ^1.1.0
2. Install it
You can install packages from the command line:
$ flutter pub get
Alternatively, your editor might support
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Mar 31, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.7.1
- pana: 0.13.6
- Flutter: 1.12.13+hotfix.8
flutter format to format
Maintain an example. (-10 points)
Create a short demo in the
example/ directory to show how to use this package.
Common filename patterns include
air_quality.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.
|Dart SDK||>=2.1.0 <3.0.0|