dart_ipify 1.1.1 copy "dart_ipify: ^1.1.1" to clipboard
dart_ipify: ^1.1.1 copied to clipboard

This package uses the remote ipify web services in order to get your public IP address or geographical details from any given IP.

example/dart_ipify_example.dart

import 'package:dart_ipify/dart_ipify.dart';
import 'package:dotenv/dotenv.dart' show load, env;

// Example
void main() async {
  load();
  var ipifyApiKeyName = 'IPIFY_API_KEY';
  var IPIFY_API_KEY =
      env.containsKey(ipifyApiKeyName) ? env[ipifyApiKeyName] : '';

  final ip = await Ipify.ipv64(format: Format.JSON);
  print(ip);

  final myGeo = await Ipify.geo(IPIFY_API_KEY.toString());
  print(myGeo.location);

  final someGeo = await Ipify.geo(IPIFY_API_KEY.toString(), ip: '8.8.8.8');
  print(someGeo);

  final balance = await Ipify.balance(IPIFY_API_KEY.toString());
  print(balance);
}
152
likes
140
pub points
98%
popularity

Publisher

unverified uploader

This package uses the remote ipify web services in order to get your public IP address or geographical details from any given IP.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

http

More

Packages that depend on dart_ipify