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

flexible_dropdown 封面
插件详情v1.0.8

flexible_dropdown

允许通过点击或滑动遮罩来关闭下拉菜单,并将标题(屏障)设置为透明

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
108
喜欢数
15
Pub 分数
150

安装插件

flutter pub add flexible_dropdown

插件介绍

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

一个增强下拉功能的 Flutter 包,允许通过点击或滑动遮罩来关闭下拉菜单,并支持带有屏障效果的透明标题。相比标准下拉菜单,它提供了更高的用户控制性和更流畅的交互体验。适用于需要在多个平台上自定义且对手势响应的下拉菜单的应用程序。该包轻量级,可通过 pub.dev 轻松集成。

适合场景

  • 可自定义的下拉菜单关闭
  • 基于手势的下拉导航
  • 透明标题设计
  • 跨平台下拉组件
  • 表单和选择界面的用户体验改进

主要特点

  • 点击遮罩区域以关闭
  • 拖动关闭手势
  • 透明标题栏支持
  • 背景的屏障效果
  • 跨平台兼容性

适合对象

  • 寻求交互式下拉菜单的开发者
  • 需要直观用户手势的应用程序
  • 专注于视觉清晰度的设计人员
  • 跨平台 Flutter 应用程序
  • 包含下拉菜单的表单型 UI

使用建议

  • 需要仔细处理手势冲突
  • 复杂布局可能需要自定义样式
  • 除了基本用法外,文档有限
  • 不适用于简单的静态下拉菜单
  • 大量项目可能带来的性能影响

原始 README

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

Flexible Dropdown Package

Features

  • Customize dropdown

  • Auto scroll to selected item position

  • Support BarrierShape.headerTrans to highlight the content above the flexible dropdown button

  • Allows the dropdown to be dismissed by tapping | panning the scrim or by pressing the escape key on the keyboard.

  • Allow to choose the Animation Type

Installation

First, add flexible_dropdown as a dependency in your pubspec.yaml file.

dependencies:
  flexible_dropdown: ^1.0.7

Usage

FlexibleDropdown(
  overlayChild: Container(
    height: 160,
    width: double.infinity,
    color: Colors.deepPurple,
  ),
  barrierColor: Colors.black38.withOpacity(.2),
  barrierShape: BarrierShape.headerTrans,
  textDirection: TextDirection.ltr,
  offset: Offset.zero,
  duration: const Duration(milliseconds: 400),
  animationType: AnimationType.size,
  animationAlignment: Alignment.topCenter,
  child: Container(
    decoration: BoxDecoration(
      borderRadius: BorderRadius.circular(6),
      color: Colors.blueAccent.withOpacity(.2),
    ),
    child: Padding(
      padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 20),
      child: Text(
        title,
        style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
      ),
    ),
  ),
)

Usage to close the flexible dropdown:

Navigator.pop(context);

Animation Type

scale scaleX scaleY
size slide fade
rotate

Note: AnimationType.size is only suitable for width of overlayChild is full screen width.

所属分类

依赖

依赖清单 1 项

  • plugin_platform_interface^2.0.2

源码仓库

使用此插件的项目

暂无相关数据。