搜尋套件、儲存庫與 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

原始碼儲存庫

使用此套件的專案

暫無相關資料。