geoip 1.0.1

  • README.md
  • Example
  • Installing
  • Versions
  • 62

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

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages 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

Analysis

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

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
46 / 100
Health:
Code health derived from static analysis. [more]
76 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80 / 100
Overall score:
Weighted score of the above. [more]
62
Learn more about scoring.

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:geoip/geoip.dart.

Suggestions

  • Maintain CHANGELOG.md.

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

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 10 hints.

    Run dartfmt to format lib/geoip.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
http >=0.11.3+16 <0.12.0 0.11.3+17
Transitive dependencies
async 2.0.7
charcode 1.1.2
collection 1.14.10
http_parser 3.1.2
path 1.6.1
source_span 1.4.0
string_scanner 1.0.2
typed_data 1.1.5