Skip to content
pubscout

ip_country_lookup

1.1.0, released 11 days ago by an unverified publisher

Retrieves public IP address and country location using no-key third-party providers.

WASM-ready
$ flutter pub add ip_country_lookup
Source repository

What it does

Retrieves a user's public IPv4 or IPv6 address and performs country and ISP lookups. It automatically falls back between multiple no-key third-party providers when services fail or time out.

AI-written summary of version 1.1.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to detect the user's country based on their public IP address.
  • You want automatic fallback between multiple free IP geolocation services.

Skip it when

  • You require absolute accuracy, as geolocation via public IP can be obscured by VPNs or proxies.
  • You need built-in caching for IP lookup results.

Strengths

  • Automatic fallback between multiple public IP and location providers.
  • IPv4 and IPv6 support.
  • Requires no API keys.

Weaknesses

  • Results are not cached, so multiple calls trigger independent requests.
  • Depending on timeouts across failed services, lookups can take several seconds to complete.
  • Public IP geolocation is approximate and prone to interference from VPNs and mobile networks.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1

Android release builds require the INTERNET permission in AndroidManifest.xml.

import 'package:ip_country_lookup/ip_country_lookup.dart';

final IpCountryLookup lookup = IpCountryLookup();
final IpCountryData data = await lookup.getIpLocationData();

if (data.responseCode == '200') {
  print('${data.countryName} (${data.countryCode})');
  print(data.isp);
}

Alternatives

Packages that do the same job and could replace ip_country_lookup.

  • http

    If you want to implement your own lightweight IP lookup logic using standard HTTP requests.

Works with

Packages commonly used together with ip_country_lookup: ones it builds on, ones built on it, and its own family.