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

插件详情v1.1.3

floatingpanel

浮动面板可帮助您创建易于使用的浮动菜单,您可以将其拖放到屏幕的任意边缘(水平方向)。

近 30 天下载
44
喜欢数
130
Pub 分数
30

安装插件

flutter pub add floatingpanel

插件介绍

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

FloatingPanel 是一个 Flutter 包,可让开发者创建可拖动的浮动菜单,这些菜单可以放置在屏幕的任意水平边缘。它为用户提供流畅、交互式的体验,可通过手势移动面板,非常适合快速访问操作或导航选项。该包轻量且能无缝集成到现有的 Flutter 应用中。通过可配置的属性,支持对外观和行为进行自定义。设计简洁,FloatingPanel 通过提供直观的方式呈现上下文控制,增强了用户界面设计。

适合场景

  • 快速操作菜单
  • 上下文导航
  • 基于手势的用户界面元素
  • 移动应用工具栏
  • 可定制的侧板
  • 用户偏好设置

主要特点

  • 可拖动定位
  • 水平边缘对齐
  • 流畅的手势支持
  • 可自定义外观
  • 轻量级实现
  • 与 Flutter 的轻松集成

适合对象

  • 移动应用开发者
  • UI/UX 设计师
  • 交互式小部件创建器
  • Flutter 初学者
  • 需要浮动控件的应用
  • 手势密集型界面

使用建议

  • 限于水平边缘
  • 无垂直边缘支持
  • 可能需要额外的样式
  • 不适合复杂布局
  • 性能取决于内容的复杂度
  • 需要手动处理边缘约束

原始 README

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

Flutter Float Box

Float Box - v1.0

Overview

alt Floating Panel

Float box is a true floating panel for your app, which can be docked to either edges of the screen (horizontally).

Code - Basic:

This is what you needs to get the widget working. Import Widget -> Add 'FloatBoxPanel' at the bottom of your stack widget. Add icons inside the "buttons" list.

import 'package:widgets/float_box.dart'; // Import Float Box Widget

Stack(
    children: [
        ...

        // Add Float Box Panel at the bottom of the 'stack' widget.
        FloatBoxPanel(
            buttons: [
                // Add Icons to the buttons list.
                Icons.message,
                Icons.photo_camera,
                Icons.video_library
            ]
        );
    ]
);

alt Floating Panel

Code - All Properties:

These are all the properties you can customize of the floating panel.

    import 'package:widgets/float_box.dart'; // Import Float Box Widget
    
    Stack(
        children: [
            ...
    
            // Add Float Box Panel at the bottom of the 'stack' widget.
            FloatBoxPanel(
                positionTop: 0.0, // Initial Top Position
                positionLeft: 0.0, // Initial Left Position
                backgroundColor: Color(0xFFEDEDED), // Color of the panel
                contentColor: Colors.black, // Color of the icons
                panelShape: PanelShape.rectangle, // 'PanelShape.rectangle' or 'PanelShape.rounded', border radius property doesn't work in the rounded shape
                borderRadius: BorderRadius.circular(8.0), // Border radius of the panel
                dockType: DockType.inside, // 'DockType.inside' or 'DockType.outside', weather to dock the panel outside or inside the edge of the screen
                dockOffset: 5.0, // Offset the dock from the edge depending on the 'dockType' property
                panelAnimDuration: 300, // Duration for panel open and close animation
                panelAnimCurve: Curves.easeOut, // Curve for panel open and close animation
                dockAnimDuration: 300, // Auto dock to the edge of screen - animation duration
                dockAnimCurve: Curves.easeOut, // Auto dock animation curve
                panelOpenOffset: 20.0, // Offset from the edge of screen when panel is open
                panelIcon: Icons.menu, // Panel open/close icon
                size: 70.0, // Size of single button in the panel
                iconSize: 24.0, // Size of icons
                borderWidth: 1.0, // Width of panel border
                borderColor: Colors.black, // Color of panel border
                onPressed: (index) {
                    print("Clicked on item: $index");
                }
                buttons: [
                    // Add Icons to the buttons list.
                    Icons.message,
                    Icons.photo_camera,
                    Icons.video_library
                ]
            );
        ]
    );

所属分类

源码仓库

使用此插件的项目

暂无相关数据。