搜索插件、代码仓与 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 项

源码仓库

使用此插件的项目

暂无相关数据。