open_weather_api 1.5.5

  • Readme
  • Changelog
  • Example
  • Installing
  • 44

A library for Dart developers.

Created from templates made available by Stagehand under a BSD-style license.

Usage #

A simple usage example:

import 'package:open_weather_api/open_weather_api.dart';

main() {
  var awesome = new Awesome();

Features and bugs #

Please file feature requests and bugs at the issue tracker.

1.0.0 #

  • Initial version, created by Stagehand


import 'dart:io';
import 'package:http/io_client.dart';
import 'package:open_weather_api/open_weather_api.dart';

import 'package:jaguar_resty/jaguar_resty.dart';

main() async {
  globalClient = IOClient();

  final apiKey = Platform.environment["OWM_API_KEY"];

  final api = OpenWeatherApi(apiKey);

  print((await api.byId("2172797")).simplified());

  print((await api.dailyForecastsById("2172797")));

  print((await api.hourlyForecastsById("2172797")).simplified());

Use this package as a library

1. Depend on it

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

  open_weather_api: ^1.5.5

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:open_weather_api/open_weather_api.dart';
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]
Learn more about scoring.

We analyzed this package on Jan 19, 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/serializer/serializer.jser.dart. (-16.51 points)

Analysis of lib/src/serializer/serializer.jser.dart reported 36 hints, including:

line 23 col 17: Unnecessary new keyword.

line 44 col 17: Unnecessary new keyword.

line 65 col 17: Unnecessary new keyword.

line 86 col 17: Unnecessary new keyword.

line 111 col 17: Unnecessary new keyword.

Fix lib/src/serializer/simple.jser.dart. (-4.89 points)

Analysis of lib/src/serializer/simple.jser.dart reported 10 hints, including:

line 13 col 28: Unnecessary new keyword.

line 16 col 33: Unnecessary new keyword.

line 34 col 17: Unnecessary new keyword.

line 52 col 29: Unnecessary new keyword.

line 55 col 44: Unnecessary new keyword.

Fix lib/src/open_weather_api_base.dart. (-0.50 points)

Analysis of lib/src/open_weather_api_base.dart reported 1 hint:

line 12 col 32: Use ; instead of {} for empty constructor bodies.

Format lib/src/models/simple.dart.

Run dartfmt to format lib/src/models/simple.dart.

Maintenance suggestions

The package description is too short. (-14 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
jaguar_resty ^2.10.12 2.10.14
jaguar_serializer ^2.2.12 2.2.12
Transitive dependencies
async 2.4.0
auth_header 2.1.4
charcode 1.1.2
client_cookie 2.2.1
collection 1.14.12
http_parser 3.1.3
meta 1.1.8
path 1.6.4
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
build_runner any
http any 0.12.0+4
jaguar_retrofit_gen any
jaguar_serializer_cli any
pedantic ^1.0.0 1.9.0
test ^1.0.0