搜索插件、代码仓与 APP 分类

info_popup 封面
插件详情v4.3.2

info_popup

在您选择的控件上向用户显示一些信息的简单方法。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
4.6万
喜欢数
165
Pub 分数
150

安装插件

flutter pub add info_popup

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

InfoPopup 是一个轻量级的 Flutter 包,可让开发者轻松地在任何小部件上显示信息弹窗,设置简单。它提供了一种简洁且可自定义的方式,向用户展示上下文信息,通过在 UI 元素上直接提供提示或引导来提升用户体验。该包支持 Android、iOS、Web、macOS、Windows 和 Linux 多个平台,确保在不同设备上行为一致。通过一条命令即可轻松集成,非常适合添加微妙但有效的用户反馈机制。

适合场景

  • 在按钮上显示工具提示
  • 提供上下文相关的帮助
  • 增强表单字段指导
  • 改进入职体验
  • 添加交互式提示
  • 显示状态说明

主要特点

  • 简单的单行集成
  • 可自定义弹出内容
  • 跨平台兼容性
  • 支持各种小部件目标
  • 可配置定位
  • 轻便且快速

适合对象

  • 寻求快速反馈工具的UI/UX设计师
  • 开发教育类应用的开发者
  • 专注于可访问性的团队
  • 需要直观用户引导的应用程序
  • 开发周期紧张的项目

使用建议

  • 仅限基本弹出样式
  • 无内置动画自定义
  • 最适合小段文本内容
  • 可能需要手动调整位置
  • 不适合复杂的模态交互

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Introduction

The info_popup package allows you to easily show a simple, customizable popup on your wrapped widget. The highlight feature, which can be activated at will, helps draw the user's attention to the desired location.

You can test it now on the Info Popup preview page. Note that the website experience may be different.

Features

  • Display a customizable popup on your wrapped widget
  • Activate the highlight feature to draw the user's attention to the desired location
  • Fully customize the content of the popup
  • Add margins to the popup from any side

MainPresentation HighlightExample

Getting Started

To use this package, add info_popup as a dependency in your pubspec.yaml file.

dependencies:
  info_popup: ^3.0.0

Alternatively, you can add it to your project by running the following commands in your terminal:

with Dart:

$ dart pub add info_popup

with Flutter:

$ flutter pub add info_popup

Usage

To show a popup, wrap the widget that you want to display the popup on with the InfoPopupWidget widget. All you have to do is wrap it in the widget you want to show information with the InfoPopupWidget widget. With the InfoPopupController, you can customize it as you wish, and turn it on and off.

import 'package:info_popup/info_popup.dart';
	InfoPopupWidget(
		contentTitle: 'Info Popup Details',
		child: Icon(
			Icons.info,
			color: Colors.pink,
		),
	),

Example

This is a normal info text displayed using the InfoPopupWidget widget with several optional parameters.

              InfoPopupWidget(
                contentTitle: 'Info Popup Details',
                arrowTheme: InfoPopupArrowTheme(
                  color: Colors.pink,
                  arrowDirection: ArrowDirection.up,
                ),
                contentTheme: InfoPopupContentTheme(
                  infoContainerBackgroundColor: Colors.black,
                  infoTextStyle: TextStyle(color: Colors.white),
                  contentPadding: const EdgeInsets.all(8),
                  contentBorderRadius: BorderRadius.all(Radius.circular(10)),
                  infoTextAlign: TextAlign.center,
                ),
                dismissTriggerBehavior: PopupDismissTriggerBehavior.onTapArea,
                areaBackgroundColor: Colors.transparent,
                indicatorOffset: Offset.zero,
                contentOffset: Offset.zero,
                onControllerCreated: (controller) {
                  print('Info Popup Controller Created');
                },
                onAreaPressed: (InfoPopupController controller) {
                  print('Area Pressed');
                },
                infoPopupDismissed: () {
                  print('Info Popup Dismissed');
                },
                onLayoutMounted: (Size size) {
                  print('Info Popup Layout Mounted');
                },
                child: Icon(
                  Icons.info,
                  color: Colors.pink,
                ),
              ),

"This is a custom popup example created using the InfoPopupWidget widget.

Custom Popup Widget
              InfoPopupWidget(
                customContent: Container(
                  decoration: BoxDecoration(
                    color: Colors.blueGrey,
                    borderRadius: BorderRadius.circular(10),
                  ),
                  padding: const EdgeInsets.all(10),
                  child: Column(
                    children: const <Widget>[
                      TextField(
                        decoration: InputDecoration(
                          hintText: 'Enter your name',
                          hintStyle: TextStyle(color: Colors.white),
                          enabledBorder: OutlineInputBorder(
                            borderSide: BorderSide(color: Colors.white),
                          ),
                        ),
                      ),
                      SizedBox(height: 10),
                      Center(
                        child: Text(
                          'Example of Info Popup inside a Bottom Sheet',
                          style: TextStyle(
                            color: Colors.white,
                          ),
                        ),
                      ),
                    ],
                  ),
                ),
                arrowTheme: const InfoPopupArrowTheme(
                  color: Colors.pink,
                  arrowDirection: ArrowDirection.up,
                ),
                dismissTriggerBehavior: PopupDismissTriggerBehavior.onTapArea,
                areaBackgroundColor: Colors.transparent,
                indicatorOffset: Offset.zero,
                contentOffset: Offset.zero,
                onControllerCreated: (controller) {
                  print('Info Popup Controller Created');
                },
                onAreaPressed: (InfoPopupController controller) {
                  print('Area Pressed');
                },
                infoPopupDismissed: () {
                  print('Info Popup Dismissed');
                },
                onLayoutMounted: (Size size) {
                  print('Info Popup Layout Mounted');
                },
                child: Icon(
                  Icons.info,
                  color: Colors.pink,
                ),
              ),

Conclusion

The info_popup package provides a simple and effective way to show a customizable popup on your wrapped widget. With the highlight feature, you can draw the user's attention to the desired location.

License

This project is licensed under the MIT License - see the LICENSE file for details.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。