一個可自訂的 ExpansionTile 小部件,源自 Flutter 的 Material 實現,設計用於增強靈活性。支援空值安全,並允許開發者客製化小部件的外觀與行為,包括自訂標題、圖示和動畫控制。非常適合建立具有獨特樣式或互動元件的可摺疊內容區塊。此套件在所有主要平台皆相容,並透過額外的設定選項擴展標準 ExpansionTile。
適用情境
自定義可摺疊UI組件
表單中的動態內容區域
互動式常見問題介面
嵌套可展開列表
可存取的導航面板
主要特色
完全空安全
可擴充的標題自訂
可設定的動畫與圖示行為
支援所有 Flutter 平台
與現有組件的輕鬆整合
適合對象
需要靈活擴展面板的開發者
UI 設計師需要視覺控制
具有複雜可展開內容的應用程式
跨平台應用
使用現代 Dart 練習的專案
使用建議
需要理解 Flutter widget 樹
可能稍微增加封包大小
限於材質設計規範
不適用於非擴展使用案例
依賴上游 Material 變化
原始 README
以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。
configurable_expansion_tile
A Configurable Expansion Tile edited from the flutter material implementation
that allows for customization of the internal components. Includes providing colours,
replacement widgets on expansion, and custom animations.
Tile animations still takes place (which are also configurable), and a widget can be set to precede and/or follow the provided header, which will rotate on expand/collapse of the tile.
Configure any or all parameters or leave default behaviour - header works out of the box.
Installation
In the dependencies: section of your pubspec.yaml, add the following line: