搜尋套件、儲存庫與 APP 分類

套件詳情v1.1.1

dart_ipify

此套件使用遠端 ipify 網路服務,以取得您的公開 IP 位址或任何給定 IP 的地理細節。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
5.9萬
喜歡數
178
Pub 分數
160

安裝套件

flutter pub add dart_ipify

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

dart_ipify 套件提供了一種簡單的方式,使用 ipify API 取得您的公開 IP 位址或地理資訊。它支援多個平台,包括 Android、iOS、Web、macOS、Windows 和 Linux,非常適合需要網路身分資訊的跨平台應用程式。該套件抽象了對 ipify 服務的 HTTP 請求,提供乾淨、易用的方法來取得 IP 資料。輕量且可靠,適用於需要即時 IP 查詢功能的應用程式。

適用情境

  • 獲取使用者的公共IP位址
  • 從IP地址獲取地理位置數據
  • 跨平台網絡診斷
  • 基於IP的用戶位置追蹤
  • 應用程式中的自動IP記錄

主要特色

  • 用於IP檢索的簡單API
  • 支援透過IP定位位置
  • 適用於所有主要平台
  • 輕量且無依賴
  • 使用安全的 HTTPS 連接
  • 與 Flutter 應用輕鬆整合

適合對象

  • 開發網路感知應用程式的開發者
  • 需要用戶IP追蹤的應用程式
  • 用於調試網路問題的工具
  • 跨平台應用程式需要IP資訊
  • 需要透過IP進行地理定位的服務

使用建議

  • 依賴外部 ipify API 的可用性
  • 免費方案可能有速率限制
  • 地理位置的準確性取決於 ipify 的資料
  • 無離線支援
  • 需要互聯網連接才能運作

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

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.

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案