cuba_weather_dart 3.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 77

Cuba Weather Dart #

License: MIT Pub Version GitHub Workflow Status

Application programming interface of the Cuba Weather project implemented in Dart.

  • To see how to install the package, follow this link.

  • To see examples of use, follow this link.

  • To see the package page on pub.dev, follow this link.

  • To see the changelog, follow this link.

Cuba Weather Dart Changelog #

[3.1.1] - March 8, 2020 #

  • Implement parser for models

[3.0.4] - March 7, 2020 #

  • Change models

[3.0.3] - March 7, 2020 #

  • Remove unnecessary new keyword

[3.0.2] - March 6, 2020 #

  • Export modules

[3.0.1] - March 3, 2020 #

  • Add new state to insmet and fix descriptions

[3.0.0] - March 3, 2020 #

  • Implement insmet today forecast
  • Implement insmet tomorrow forecast
  • Implement insmet perspective forecast
  • Implement insmet marine forecast

[2.6.0] - March 3, 2020 #

  • Make package atomic
  • Remove another dependencies
  • Fix name of municipalities

[2.5.1] - February 9, 2020 #

  • Update dependencies

[2.5.0] - February 4, 2020 #

  • Update dependencies

[2.4.0] - February 4, 2020 #

  • Add radians and degree of wind

[2.3.0] - January 27, 2020 #

  • Add all directions of wind

[2.2.0] - January 27, 2020 #

  • Implement parse for wind direction

[2.1.0] - January 26, 2020 #

  • Get today's weather forecast information
  • Get drought status information
  • Get description state information

[2.0.1] - January 26, 2020 #

  • Implement windstring parser for obtain velocity and direction of wind

[2.0.0] #

  • Use forecast from insmet.cu
  • Merge information fron insmet.cu and redcuba.cu

[1.3.3] - January 21, 2020 #

  • Add new locations
  • Implement health suggestions

[1.3.2] - January 16, 2020 #

  • Remove the tests, because the test package creates conflict with flutter_test.

[1.3.1] - January 15, 2020 #

  • Use Datetime class for date
  • Fix error in double conversion

[1.3.0] - January 15, 2020 #

  • Remove locations duplicates
  • Use double type instance of int type

[1.2.1] - January 12, 2020 #

  • Implement Damerau Levenshtein distance without extra dependency
  • Remove unnecessary dependencies

[1.2.0] - January 12, 2020 #

  • Restructure code
  • Optional suggestion
  • Correct handling exceptions
  • Improve README.md

[1.1.5] - January 11, 2020 #

  • Fix error in GitHub Actions

[1.1.4] - January 10, 2020 #

  • Implement actions for master and develop branchs

[1.1.3] - January 10, 2020 #

  • Autopublish in pub.dev with GitHub Actions

[1.1.2] - January 10, 2020 #

  • Fix errors in dependencies

[1.1.1] - January 10, 2020 #

  • Fix variable names
  • Fix errors in dependencies

[1.1.0] - January 10, 2020 #

  • Find location with Levenshtein distance
  • Improve example

[1.0.0] - January 10, 2020 #

  • Create GitHub workflow
  • Add README license badge
  • Add README package version badge
  • Add README build result badge
  • Document code

[0.1.4] - January 10, 2020 #

  • Fix error in wind property
  • Fix error in location sort
  • Improve example
  • Improve test

[0.1.3] - January 9, 2020 #

  • Remove unnecessary code
  • Add CODE_OF_CONDUCT.md
  • Improve README.md

[0.1.2] - January 9, 2020 #

  • Fix example README.md

[0.1.1] - January 9, 2020 #

  • Remove Flutter dependency
  • Use Test Dart package instance of Flutter Test
  • Add pubspec.yaml to example
  • Fix example
  • Fix test

[0.1.0] - January 9, 2020 #

  • Improve package description
  • Format code
  • Add example
  • Change homepage

[0.0.1] - January 9, 2020 #

  • Initial implementation of Dart client for www.redcuba.cu weather API.

example/example.dart

import 'dart:io';

import 'package:cuba_weather_dart/cuba_weather_dart.dart';

void main() {
  print('Insert municipality:');
  var input = stdin.readLineSync();
  var cubaWeather = CubaWeather();
  cubaWeather.get(input).then((weather) {
    print(weather);
  });
}

Use this package as a library

1. Depend on it

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


dependencies:
  cuba_weather_dart: ^3.1.1

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:cuba_weather_dart/cuba_weather_dart.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
58
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
77
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.6

Health suggestions

Fix lib/src/repositories/insmet_forecast_repository.dart. (-1 points)

Analysis of lib/src/repositories/insmet_forecast_repository.dart reported 2 hints:

line 157 col 19: Avoid empty catch blocks.

line 164 col 19: Avoid empty catch blocks.

Format lib/src/models/insmet_marine_forecast_model.dart.

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

Format lib/src/models/insmet_weather_day_model.dart.

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

Fix additional 6 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/models/municipality_model.dart (Run dartfmt to format lib/src/models/municipality_model.dart.)
  • lib/src/models/redcuba_weather_date_model.dart (Run dartfmt to format lib/src/models/redcuba_weather_date_model.dart.)
  • lib/src/models/redcuba_weather_model.dart (Run dartfmt to format lib/src/models/redcuba_weather_model.dart.)
  • lib/src/models/source_model.dart (Run dartfmt to format lib/src/models/source_model.dart.)
  • lib/src/models/weather_forecast_model.dart (Run dartfmt to format lib/src/models/weather_forecast_model.dart.)
  • lib/src/models/weather_model.dart (Run dartfmt to format lib/src/models/weather_model.dart.)

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (xml).

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
html ^0.14.0+3 0.14.0+3
http ^0.12.0 0.12.0+4
json_annotation ^3.0.1 3.0.1
xml ^3.7.0 3.7.0 4.1.0
Transitive dependencies
async 2.4.1
charcode 1.1.3
collection 1.14.12
convert 2.1.1
csslib 0.16.1
http_parser 3.1.4
meta 1.1.8
path 1.6.4
pedantic 1.9.0
petitparser 3.0.2
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
build_runner ^1.8.0
json_serializable ^3.2.5