openweather 3.9.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 55

OpenWeather API Client. #

An API Client to communicate with OpenWeather API

Usage #

A simple usage example:

import 'package:openweather/openweather.dart';

main() async {
  var client = OpenWeatherClient("SOMEAPIKEY");
  CityWeather weatherData =
      await client.getCityWeatherByCityName("Dhaka");
  print(weatherData.name); // Dhaka
}

Features and bugs #

Please file feature requests and bugs at the repository.

3.9.2 #

  • Small fix.

3.9.1 #

  • Typo fixes.

3.9.0 #

  • Trigger API.

3.0.1 #

  • Removed unused import.

3.0.0 #

  • UVIndex API
  • CityWeather timestamp getter fix.

2.0.0 #

  • Hourly Forecast API.
  • 3 Hourly Forecast API.

1.9.0 #

  • Complete Current Weather API with rectangle and cities in circle features.

1.0.1 #

  • Added longer description as suggested.

1.0.0 #

  • Initial version, with current weather API.

example/openweather_example.dart

import 'package:openweather/openweather.dart';

main() async {
  var client = OpenWeatherClient("SOMEAPIKEY");
  CityWeather weatherData =
      await client.getCityWeatherByCityName("Dhaka");
  print(weatherData.name); // Dhaka
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  openweather: ^3.9.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:openweather/openweather.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
20
Health:
Code health derived from static analysis. [more]
82
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
55
Learn more about scoring.

We analyzed this package on Jan 16, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

Health suggestions

Fix lib/src/models.dart. (-11.33 points)

Analysis of lib/src/models.dart reported 24 hints, including:

line 45 col 15: Unnecessary new keyword.

line 48 col 40: Unnecessary new keyword.

line 50 col 16: Unnecessary new keyword.

line 52 col 41: Unnecessary new keyword.

line 53 col 41: Unnecessary new keyword.

Fix lib/src/api.dart. (-7.71 points)

Analysis of lib/src/api.dart reported 16 hints, including:

line 29 col 9: Unnecessary new keyword.

line 186 col 14: Unnecessary new keyword.

line 198 col 14: Unnecessary new keyword.

line 209 col 14: Unnecessary new keyword.

line 223 col 14: Unnecessary new keyword.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
http ^0.12.0+2 0.12.0+4
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.12
http_parser 3.1.3
meta 1.1.8
path 1.6.4
pedantic 1.9.0
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
test ^1.0.0