seeip_client 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 73

seeip client #

A library that makes it easy to fetch data from SeeIP - A simple IP address API.

This is a pure Dart library which relies on the http package. Therefore, it can be used cross-platform, from Flutter to Web to server-side.

Usage #

You can fetch data from SeeIP without any api or auth tokens. Simply create an instance of the SeeipClient class.

Please see example/seeip_client_example.dart for moe examples.

import 'package:seeip_client/seeip_client.dart';

main() async {
  SeeipClient seeip = SeeipClient();

  OnlyIP ipaddress = await seeip.getIP();

  print(ipaddress);
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0.1.1 #

  • Bug fix - Added parsing for int Lat/Long coordinates.

0.1.0 #

  • Initial version, created by Mad About Brighton.

example/seeip_client_example.dart

// Copyright (c) 2019, Mad About Brighton. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:seeip_client/seeip_client.dart';

main() async {
  SeeipClient seeip = SeeipClient();

  // Fetches only the IP address of the requesting device.
  OnlyIP ip = await seeip.getIP();

  print(ip);

  // Fetches only the IPv4 address of the requesting device.
  OnlyIP ipv4 = await seeip.getIPv4();

  print(ipv4);

  // Fetches the Geo IP of the requesting device.
  GeoIP geoIP = await seeip.getGeoIP();

  print(geoIP);

  // Fetches the Geo IP of the specified IP address.
  GeoIP geoIPSpecific = await seeip.getGeoIP('216.58.208.174');

  print(geoIPSpecific);
}

Use this package as a library

1. Depend on it

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


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

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

  • Dart: 2.6.0
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

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

Health suggestions

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

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

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

Format lib/src/models/geo_ip.dart.

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

Format lib/src/models/only_ip.dart.

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

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
http ^0.12.0+2 0.12.0+2
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.12
http_parser 3.1.3
meta 1.1.8
path 1.6.4
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
mockito ^4.0.0
pedantic ^1.0.0 1.8.0+1
test ^1.0.0