搜索插件、代码仓与 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

所属分类

源码仓库

使用此插件的项目

暂无相关数据。