搜尋套件、儲存庫與 APP 分類

expandable_group 封面
套件詳情v0.0.8

expandable_group

一個新的Flutter組件支援使用者展開和收起清單。

近 30 天下載
69
喜歡數
7
Pub 分數
70

安裝套件

flutter pub add expandable_group

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

expandable_group 套件提供了一個 Flutter 小部件,讓使用者能夠建立具有可摺疊與可展開區段的清單。它簡化了可動態顯示或隱藏內容之互動式清單項目的實作,進而改善資料密集介面中的使用者體驗。適用於常見問題、設定選單或任何依邏輯分組的內容,支援順暢動畫與易於自訂。此套件輕量且能無縫整合至現有的 Flutter 項目中。

適用情境

  • 常見問題區段
  • 設定面板
  • 動態內容清單
  • 可摺疊導航
  • 資料分組

主要特色

  • 平滑的展開/收合動畫
  • 可自訂的標題和內容
  • 與 ListView 的輕鬆整合
  • 支援嵌套群組
  • 輕量且高效

適合對象

  • 開發互動式清單的開發者
  • 具有層級資料的應用程式
  • 需要動態內容切換的 UI
  • 初學者學習 Flutter 小部件
  • 需要乾淨、可重用元件的專案

使用建議

  • 有限的平台特定樣式選項
  • 無內建的鍵盤導航支援
  • 複雜用例可能需要額外的狀態管理
  • 未針對無分頁的大資料集進行優化

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

ExpandableGroup

A new Flutter widget support expanded and collapsed group items in the list of Flutter application. It supports Android, iOS, Web and Desktop.

Build expandable group widget support expanded and collapsed group data.

Features

  • Expand and collapse header in the List
  • Support customise header and item in the list
  • Single ListView

Getting Started

1. Add dependency to your project's pubspec.yaml and run pub get
dependencies:
  expandable_group: ^0.0.6
2. Import expandable_group_widget.dart to your file project where is going to use the ListExpandableWidget.
import 'package:expandable_group/expandable_group_widget.dart';
3. The ExpandableGroup has some properties as below
3.1 Required
  • header the header widget and will display in the list
  • items the list of ListTile will display for each group
3.2 Optional
  • isExpanded is a boolean to expand or collapse header. isExpanded == true is the header will be expanded and otherwise. The default value is false.
  • expandedIcon and collapsedIcon are the widgets for expanded and collapsed state.
  • headerEdgeInsets the EdgeInsets of header widget
  • headerBackgroundColor can customise header background color
4. Examples
ExpandableGroup(
    isExpanded: index == 0,
    header: _header('Group $index'),
    items: _buildItems(context, group),
    headerEdgeInsets: EdgeInsets.only(left: 16.0, right: 16.0)
)

Submit bugs or request features

Please file feature requests and bugs with GitHub issues tab

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。