geoip 1.0.1

  • README.md
  • Example
  • Installing
  • Versions
  • 32

geoIP

A wrapper of ip-thingy.com for geolocation via IP addresses in Dart

By: Evan Pratten

How to use

import 'package:geoip/geoip.dart' as geoip;

main() async {
  var Data = await geoip.GetData("1.1.1.1");

  print(geoip.latlong(Data)[0]); // Print latitude

  print(geoip.latlong(Data)[1]); // Print longitude

  print(geoip.ipnumber(Data)); // Print ip address number

  print(geoip.protoversion(Data)); //Print internet protocall version

  print(geoip.region(Data)); // Print  region

  print(geoip.countrycode(Data)); // Print countrycode

  print(geoip.country(Data)); // Print country

  print(geoip.city(Data)); // Print city

  print(geoip.timezone(Data)); // Print timezone (+10:00)

  print(geoip.zipcode(Data)); // Print zipcode
}

example/example.dart

import 'package:geoip/geoip.dart' as geoip;

main() async {
  var Data = await geoip.GetData("1.1.1.1");

  print(geoip.latlong(Data)[0]); // Print latitude

  print(geoip.latlong(Data)[1]); // Print longitude

  print(geoip.ipnumber(Data)); // Print ip address number

  print(geoip.protoversion(Data)); //Print internet protocall version

  print(geoip.region(Data)); // Print  region

  print(geoip.countrycode(Data)); // Print countrycode

  print(geoip.country(Data)); // Print country

  print(geoip.city(Data)); // Print city

  print(geoip.timezone(Data)); // Print timezone (+10:00)

  print(geoip.zipcode(Data)); // Print zipcode
}

Use this package as a library

1. Depend on it

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


dependencies:
  geoip: ^1.0.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:geoip/geoip.dart';
  
Version Uploaded Documentation Archive
1.0.1 May 4, 2018 Go to the documentation of geoip 1.0.1 Download geoip 1.0.1 archive
1.0.0 May 4, 2018 Go to the documentation of geoip 1.0.0 Download geoip 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
37
Health:
Code health derived from static analysis. [more]
7
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
55
Overall:
Weighted score of the above. [more]
32
Learn more about scoring.

We analyzed this package on Sep 18, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.3

Platforms

Detected platforms: unsure

Low code quality prevents platform classification.

Issues and suggestions

Fix platform conflicts.

Low code quality prevents platform classification.

Fix lib/geoip.dart.

Analysis of lib/geoip.dart failed with 9 errors, 1 hint, including:

line 16 col 14: Undefined name 'JSON'.

line 22 col 14: Undefined name 'JSON'.

line 28 col 14: Undefined name 'JSON'.

line 34 col 14: Undefined name 'JSON'.

line 40 col 14: Undefined name 'JSON'.

Maintain CHANGELOG.md.

Changelog entries help clients to follow the progress in your code.

Add SDK constraint in pubspec.yaml.

For information about setting SDK constraint, please see https://www.dartlang.org/tools/pub/pubspec#sdk-constraints.

Dependencies

Package Constraint Resolved Available
Direct dependencies
http >=0.11.3+16 <0.12.0 0.11.3+17
Transitive dependencies
async 2.0.8
charcode 1.1.2
collection 1.14.11
http_parser 3.1.3
meta 1.1.6
path 1.6.2
source_span 1.4.1
string_scanner 1.0.4
typed_data 1.1.6