fetchIpCountryCode method

  1. @override
Future<String> fetchIpCountryCode()
override

Returns 2-letter IP-based country code, or empty string if unavailable.

Implementation

@override
Future<String> fetchIpCountryCode() async {
  if (_cachedIpCountryCode.isNotEmpty) return _cachedIpCountryCode;
  await fetchGeoInfo(Uri.parse(_primaryUrl));
  return _cachedIpCountryCode;
}