country_ip
3.0.0, released 3 years ago by nirmalcode.com
Find a user's country from their current or specified IP address.
WASM-ready
What it does
Fetches the country name, country code, and IP address using the country.is API. It supports finding the location of the current user or querying a specific IPv4 or IPv6 address.
AI-written summary of version 3.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to determine a user's country based on their IP address.
- You want a free IP geolocation API client that requires no API key.
Skip it when
- You need detailed geolocation data beyond just the country (like city, region, or coordinates).
- You need offline IP lookup capabilities.
Strengths
- Supports both IPv4 and IPv6 addresses.
- No API key or authorization required.
- Simple and straightforward API.
Weaknesses
- Depends on an external web service (country.is).
- Provides only country-level data.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Not documented
final countryIpResponse = await CountryIp.find();
print("User's country code : \${countryIpResponse?.countryCode}");Alternatives
Packages that do the same job and could replace country_ip.