Search packages, repositories and app categories

Package detailsv1.1.1

dart_ipify

This package uses the remote ipify web services in order to get your public IP address or geographical details from any given IP.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
59K
Likes
178
Pub points
160

Install package

flutter pub add dart_ipify

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The dart_ipify package provides a simple way to retrieve your public IP address or geographical information using the ipify API. It supports multiple platforms including Android, iOS, Web, macOS, Windows, and Linux, making it ideal for cross-platform applications that need network identity details. The package abstracts HTTP requests to the ipify service, offering clean, easy-to-use methods for fetching IP data. It's lightweight and reliable for apps requiring real-time IP lookup functionality.

Use cases

  • Fetching user's public IP address
  • Retrieving geolocation data from an IP
  • Cross-platform network diagnostics
  • User location tracking based on IP
  • Automated IP logging in apps

Key features

  • Simple API for IP retrieval
  • Supports geolocation via IP
  • Works across all major platforms
  • Lightweight and dependency-free
  • Uses secure HTTPS connections
  • Easy integration with Flutter apps

Suitable for

  • Developers building network-aware apps
  • Apps needing user IP tracking
  • Tools for debugging network issues
  • Cross-platform applications requiring IP info
  • Services that require geolocation by IP

Considerations

  • Relies on external ipify API availability
  • Rate limits may apply on free tier
  • Geolocation accuracy depends on ipify's data
  • No offline support
  • Requires internet connection for operation

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Dart Ipify

An unofficial client library for Ipify <https://www.ipify.org/> A Simple Public IP Address API, Likewise a geographical IP address details API.

GitHub license pub package Opensource Workflow

About ipify

Using ipify is ridiculously simple. You can get your public IP directly or you can get the precise physical location of a given IP address. so if you only have as much as an IP address, you can still find out its geographical details.

Meta

  • Author: Khalil Mejdi
  • Email: [khalil.mejdi](mailto:khalil.mejdi97@gmail.com)
  • Status: maintained, active

Purpose

This library makes getting your public IP address or the precise geographical details of a given IP address with the dart language extremely simple using Ipify's API.

Installation

dependencies:
  dart_ipify: ^1.1.1

Usage

Using this library is very simple. Here's a simple example:

IP Address API
import 'package:dart_ipify/dart_ipify.dart';

void main() async {
  final ipv4 = await Ipify.ipv4();
  print(ipv4); // 98.207.254.136

  final ipv6 = await Ipify.ipv64();
  print(ipv6); // 98.207.254.136 or 2a00:1450:400f:80d::200e

  final ipv4json = await Ipify.ipv64(format: Format.JSON);
  print(ipv4json); //{"ip":"98.207.254.136"} or {"ip":"2a00:1450:400f:80d::200e"}

  // The response type can be text, json or jsonp
}
IP Geolocation API
import 'package:dart_ipify/dart_ipify.dart';

void main() async {
  final mygeo = await Ipify.geo('at_apiKeyxxxxxxxxxxxxxxxxxxxxxxx');
  print(mygeo.location);

  final somegeo = await Ipify.geo('at_apiKeyxxxxxxxxxxxxxxxxxxxxxxx', ip: '8.8.8.8');
  print(somegeo);

  final balance = await Ipify.balance('at_apiKeyxxxxxxxxxxxxxxxxxxxxxxx');
  print(balance);
}

Changelog

All library #changes, in descending order.

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package