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

套件詳情v3.1.3

flutter_icmp_ping

一個向網路主機發送 ICMP ECHO_REQUEST 的 Flutter 插件。

AndroidiOS
近 30 天下載
4.3萬
喜歡數
15
Pub 分數
150

安裝套件

flutter pub add flutter_icmp_ping

套件介紹

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

一個 Flutter 插件,可啟用 ICMP ECHO_REQUEST(ping)功能,用於測試與遠端主機的網路連接。它允許開發者透過發送 ICMP 封包並測量回應時間,來檢查裝置或伺服器是否可透過網路存取。專為 Android 和 iOS 設計,提供簡單的 API,便於將 ping 操作整合到應用程式中,用於網路診斷、健康檢查或連接監控。該插件利用平台特定的實作,確保在兩個作業系統之間的相容性。

適用情境

  • 網路可達性測試
  • 應用健康監控
  • 連接品質評估
  • 伺服器可用性檢查
  • 應用中的診斷工具

主要特色

  • 支援 Android 和 iOS 平台
  • 用於發送 ICMP ping 的簡單 API
  • 測量往返響應時間
  • 跨平台一致性
  • 輕量級且專注於 ping 功能

適合對象

  • 網路診斷應用程式
  • 監控服務
  • 適用於應用開發者的 DevTools
  • 物聯網裝置連接檢查
  • 需要即時網路狀態的應用程式

使用建議

  • 需要 Android 上的適當系統權限
  • 僅限 ICMP ping
  • 不支援其他協議
  • 可能被防火牆或網路政策阻止
  • iOS 需要為 ICMP 存取進行額外設定

原始 README

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

flutter_icmp_ping

Flutter plugin that sends ICMP ECHO_REQUEST.

pub package

Supported platforms

  • Flutter Android
  • Flutter iOS

Getting Started

To use this plugin, add flutter_icmp_ping as a dependency in your pubspec.yaml file.

dependencies:
  flutter_icmp_ping:

Import the library in your file.

import 'package:flutter_icmp_ping/flutter_icmp_ping.dart';

See the example directory for a complete sample app using Ping. Or use the Ping like below.

try {
  final ping = Ping(
    'google.com',
    count: 3,
    timeout: 1,
    interval: 1,
    ipv6: false,
    ttl: 40,
  );
  ping.stream.listen((event) {
    print(event);
  });
} catch (e) {
  print('error $e');
}

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。