public_ip_address 1.2.1 copy "public_ip_address: ^1.2.1" to clipboard
public_ip_address: ^1.2.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

20
likes
150
points
6.42k
downloads

Publisher

verified publishersumanrajpathak.com.np

Weekly Downloads

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

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

http

More

Packages that depend on public_ip_address