一个可自定义的 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: