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

data_usage 封面
套件詳情v1.0.3

data_usage

一個用於在行動裝置上取得資料使用情況的 Flutter 插件

AndroidiOS
近 30 天下載
65
喜歡數
22
Pub 分數
120

安裝套件

flutter pub add data_usage

套件介紹

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

data_usage 套件是一個 Flutter 插件,讓開發者能夠在 Android 與 iOS 裝置上取得即時的資料使用統計資訊。它提供對行動網路與 Wi-Fi 資料消耗的存取,協助使用者監控其網路使用狀況。此套件專為跨平台相容性設計,可輕鬆整合至 Flutter 應用程式中,設定簡單。該套件利用原生裝置 API 以確保資料收集的準確性,非常適合專注於網路管理、計費或使用者意識的應用程式。其輕量級設計確保高效能表現,且不會影響應用程式的回應速度。

適用情境

  • 監控移動數據使用情況
  • 建構網路使用狀況儀表板
  • 在應用程式中整合資料警示
  • 支援計費或配額系統
  • 建立網路健康監控工具

主要特色

  • 跨平台支援(Android 與 iOS)
  • 即時資料使用情況檢索
  • 最小設置和整合
  • 精確的原生 API 存取
  • 輕量且高效

適合對象

  • 網路監控應用
  • 移動實用工具
  • 計費和配額追蹤
  • 面向使用者的資料顯示儀表板
  • 網路分析的開發工具

使用建議

  • 需要在兩個平台上具備相應的權限
  • 資料準確性可能因設備製造商而異
  • 僅限基本資料使用指標
  • 可能需要背景執行權限
  • 網頁或桌面平台無法使用

原始 README

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

Data Usage

Data Usage gets Mobile/Wifi data usage values from mobile devices, on android it will fetch the data per app but due to current limitations on ios it can only give the total/complete values of overall data used.

Screen Shots

Usage for Android

  • Initialize plugin and requests for permission
  • Request Data usage stats
  DataUsageModel.init() // Only Required for Android
  List<DataUsageModel> dataUsage = await DataUsage.dataUsageAndroid(
     withAppIcon: true, // if false `DataUsageModel.appIconBytes` will be null
     dataUsageType: DataUsageType.wifi, // DataUsageType.wifi | DataUsageType.mobile
     oldVersion: false // will be true for Android versions lower than 23 (MARSHMELLOW)
   );

This would return:

   [   ...,
      DataUsageModel({
            String appName; //App's Name
            String packageName; // App's package name
            Uint8List appIconBytes; // Icon in bytes
            int received; // Amount of data Received
            int sent; // Amount of data sent/transferred
      })
   ]

For more explanation

Usage for iOS

Request for Total data usage on iOS devices

  IOSDataUsageModel dataUsage = await DataUsage.dataUsageIOS();

This would return:

  IOSDataUsageModel({
     int wifiCompelete, // Total Amount of wifi data (received + sent)
     int wifiReceived, // Amount of wifi data Received
     int wifiSent, // Amount of data sent/transferred
     int wwanCompelete, // Total Amount of mobile data (received + sent)
     int wwanReceived, // Amount of mobile data Received
     int wwanSent // Amount of data sent/transferred
  });

Contribution

Lots of PR's would be needed to make this plugin standard, as for iOS there's a permanent limitation for getting the exact data usage, there's only one way arount it and it's super complex.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。