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

This package allows you to get your public IP Address and many others info about it.

example/README.md

Usage #

To get your ip address, just use IpAddress.getIp():

import 'package:public_ip_address/public_ip_address.dart';

void main() async {
  var ip = await IpAddress.getIp();
  print(ip);
  // Sample Output : 208.XX.XX.XX
  var allIP = await IpAddress.getAllData();
  print(allIP);
  //Sample Output :
  // {ip: 202.XX.XX.XX, continentCode: AS, country: [COUNTRY NAME], 
  // countryCode: [COUNTRY CODE], countryCode3: [COUNTRY CODE 3],
  // latitude: [LAT],longitude: [LNG], timeZone: Asia/Kathmandu, offset: 20700,
  // asn: 4007,organization: [ISP ORGANIZATION NAME] region: [REGION], regionCode: [REGION CODE]}
}

Don't forget to await it because it's a Future function.

11
likes
160
pub points
89%
popularity

Publisher

verified publishersumanrajpathak.com.np

This package allows you to get your public IP Address and many others info about it.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

http

More

Packages that depend on public_ip_address