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.
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.
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';
voidmain() async {
final ipv4 = awaitIpify.ipv4();
print(ipv4); // 98.207.254.136final ipv6 = awaitIpify.ipv64();
print(ipv6); // 98.207.254.136 or 2a00:1450:400f:80d::200efinal ipv4json = awaitIpify.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';
voidmain() async {
final mygeo = awaitIpify.geo('at_apiKeyxxxxxxxxxxxxxxxxxxxxxxx');
print(mygeo.location);
final somegeo = awaitIpify.geo('at_apiKeyxxxxxxxxxxxxxxxxxxxxxxx', ip: '8.8.8.8');
print(somegeo);
final balance = awaitIpify.balance('at_apiKeyxxxxxxxxxxxxxxxxxxxxxxx');
print(balance);
}