public_ip_address 1.2.0 copy "public_ip_address: ^1.2.0" to clipboard
public_ip_address: ^1.2.0 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

20
likes
140
pub points
91%
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