FLUTTER ECOSYSTEM

Bujupah/dart_ipify

dart용 비공식 ipify 클라이언트 라이브러리입니다.

dart_ipify 프로젝트 이미지
Stars
26
Forks
2
최근 푸시(UTC)
2024. 8. 30.
프로젝트 상태
활성
Khalil Mejdi GitHub avatar
GITHUB User

Khalil Mejdi ↗

Trying my best.

Tunisia, TN
언어Dart

기술 주제

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 4 개
  • http—
  • pedantic개발 의존성^1.11.0
  • test개발 의존성^1.16.6
  • dotenv개발 의존성—

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

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.