geopoint 0.2.3

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 78

Geopoint #

pub package Build Status Coverage Status

Geospatial data structures for Dart

Models #

GeoPoint #

Datastructure:

   String name;
   final double latitude; // required
   final double longitude; // required
   String slug;
   int timestamp;
   double latitude;
   double longitude;
   double altitude;
   double speed;
   double accuracy;
   double speedAccuracy;
   double heading;
   String number;
   String street;
   String locality;
   String sublocality;
   String postalCode;
   String subregion;
   String region;
   String country;
   List<File> images;

Extra constructors:

   /// from a [LatLng]
   GeoPoint.fromLatLng(name: "Position", point: LatLng(51.0,0.0));

   /// from json
   GeoPoint.fromJson(jsonData);

Methods and getters:

   /// get the formated address
   String address = geoPoint.address;

   /// get the [LatLng] point
   LatLng point = geoPoint.point;

   /// convert to json
   Map<String, String> json = geoPoint.toMap();

GeoSerie #

Datastructure:

   final String name; // required
   final int id;
   GeoSerieType type;  /// one of [GeoSerieType.group]
                       /// [GeoSerieType.line] or
                       /// [GeoSerieType.polygon]
   List<GeoPoint> geoPoints;
   num surface;
   GeoSerie boundary;
   GeoPoint centroid;

Extra constructors:

   /// from json
   GeoSerie geoSerie = GeoSerie.fromJson(jsonData);

   /// from strings
   GeoSerie geoSerie = GeoSerie.fromNameAndType(
       name: "A polygon",
       type: GeoSerieType.polygon,
       // or typeStr: "polygon"
   );

Methods and getters:

   // convert to json
   Map<String, String> jsonData = geoSerie.toMap();

   // get the type as a string
   String type = geoSerie.typeStr;

Changelog #

0.2.3 #

  • Add tests
  • Minor fixes

0.2.2 #

  • Downgrade to meta 1.1.6 to be compatible with flutter_test

0.2.1 #

  • Add missing meta dependency

0.2.0 #

Breaking change: remove the Geolocator and Flutter dependencies, converting this to a pure Dart library

0.1.1 #

  • Apply more strict linting rules
  • Improve docstrings

0.1.0 #

Initial release

Use this package as a library

1. Depend on it

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


dependencies:
  geopoint: ^0.2.3

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:geopoint/geopoint.dart';
  
Version Uploaded Documentation Archive
0.2.3 May 5, 2019 Go to the documentation of geopoint 0.2.3 Download geopoint 0.2.3 archive
0.2.2 May 2, 2019 Go to the documentation of geopoint 0.2.2 Download geopoint 0.2.2 archive
0.2.1 May 1, 2019 Go to the documentation of geopoint 0.2.1 Download geopoint 0.2.1 archive
0.2.0 May 1, 2019 Go to the documentation of geopoint 0.2.0 Download geopoint 0.2.0 archive
0.1.1 Mar 15, 2019 Go to the documentation of geopoint 0.1.1 Download geopoint 0.1.1 archive
0.1.0 Feb 26, 2019 Go to the documentation of geopoint 0.1.0 Download geopoint 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
61
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
78
Learn more about scoring.

We analyzed this package on Jun 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.2
  • pana: 0.12.18

Platforms

Detected platforms: Flutter, other

Primary library: package:geopoint/geopoint.dart with components: io.

Health suggestions

Fix lib/src/models/geopoint.dart. (-0.50 points)

Analysis of lib/src/models/geopoint.dart reported 1 hint:

line 125 col 7: DO use curly braces for all flow control structures.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and geopoint.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
latlong ^0.6.1 0.6.1
meta ^1.1.6 1.1.7
slugify2 ^0.2.0 0.2.1
Transitive dependencies
ansicolor 1.0.2
console_log_handler 1.1.6
intl 0.15.8
logging 0.11.3+2
path 1.6.2
validate 1.7.0
Dev dependencies
test ^1.5.1
test_coverage ^0.2.3