v1.0.8+5internet_popup
インターネット接続がオフになっているときにポップアップメッセージを表示するパッケージです。インターネット接続がオフまたは接続されているがインターネットに接続されていない場合に、ポップアップを初期化するための1行を書きます。
インターネット接続がないときにポップアップを表示するパッケージ
{"sdk":"flutter"}^3.1.1^1.24.9^3.0.0以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。
A package that shows a pop up alert when the internet connection is lost
App Screenshot
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();