GetCountryIp class

A service class to retrieve the user's public IP address and associated location information.

GetCountryIp fetches the public IP address using external services like ipify.org or icanhazip.com, and then looks up location details such as country, region, city, and ISP by querying IP geolocation APIs.

Example:

final getCountryIp = GetCountryIp();
final locationData = await getCountryIp.getIPLocation();
print(locationData);

Constructors

GetCountryIp.new()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getIPLocation() Future<Map<String, dynamic>?>
Retrieves the user's current public IP address and corresponding geolocation information.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited