v2.0.2internet_popup
一個在網路連接關閉時顯示彈出訊息的套件。撰寫一行程式碼,以在網路連接關閉或已連接但無網路時初始化彈出訊息。
一個在沒有互聯網連接時創建彈出視窗的套件
以下為英文專案原文快照,最新內容請造訪 GitHub。
A package that shows a pop up alert when the internet connection is lost
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();
依賴清單 4 項
{"sdk":"flutter"}^3.1.1^1.24.9^3.0.0先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗