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

internet_popup 封面
套件詳情v2.0.2

internet_popup

一個在網路連接關閉時顯示彈出訊息的套件。撰寫一行程式碼,以在網路連接關閉或已連接但無網路時初始化彈出訊息。

近 30 天下載
37
喜歡數
53
Pub 分數
160

安裝套件

flutter pub add internet_popup

套件介紹

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

internet_popup 套件提供了一種簡單的方式,在設備的網路連接中斷或恢復時顯示彈出訊息。它即時監控網路狀態,並根據連線變更觸發可自訂的彈出通知。適用於需要使用者關注網路可用性的應用,確保使用者能立即得知連線狀態,無需手動檢查。此套件可與 Flutter 應用程式無縫整合,並支援 Android 與 iOS 平台。

適用情境

  • 互聯網斷開時顯示警告
  • 重新連接時通知使用者
  • 改善離線期間的使用者體驗
  • 為依賴網路的操作提供反饋
  • 啟用自動網絡狀態監控

主要特色

  • 即時互聯網狀態檢測
  • 可自定的彈出訊息
  • 與 Flutter 的輕鬆整合
  • 同時支援 Android 和 iOS
  • 所需設定最少

適合對象

  • 需要網路感知的移動應用
  • 具有線上功能的面向使用者的應用程式
  • 需要離線模式通知的應用程式
  • 尋求輕量級連接解決方案的開發者
  • 依賴開銷最小的專案

使用建議

  • 需要在清單中加入網路權限
  • 僅限基本彈出通知
  • 沒有高級自定義選項
  • 不處理代理或Wi-Fi特定問題
  • 可能需要額外的樣式以保持UI一致性

原始 README

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

internet_popup

A package that shows a pop up alert when the internet connection is lost

GitHub License

App Screenshot

Features

  • auto popUp
  • option to fix or pop the warning
  • one line implementation
  • callBack function to do something after internet connectivity status change

Usage

initialize InternetPopup class and add context inside initState() funtion of the top of your widget tree.

 InternetPopup().initialize(context: context);

when the widget is popped from widget tree, initialize it again on next page.

If you want your own widget to popUp, use

 InternetPopup().initializeCustomWidget(context: context, widget: /*** your custom widget ***/);

You can write custom message title and description using customMessage and customDescription parameter inside initialize.

use onTapPop parameter to decide if the box can be removed before internet connection is back online.

You can use checkInternet function to get a Future value to check connectivity manually before some task.

 bool isConnected = await InternetPopup().checkInternet();

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。