Flutter ExpansionPanelList 去除展开后的间隔距离,及属性

可展开列表中,展开后条目有一个间距,可以 使用materialGapSize: 0,来去掉

Dart 复制代码
// child: ExpansionPanelList(
      //expandedHeaderPadding: EdgeInsets.zero,//头部顶部间隔
      //    materialGapSize: 15,//展开后的间距
      //   animationDuration: const Duration(milliseconds: 300), //动画时间
    // dividerColor: Colors.white 分割颜色
        // elevation: 1 阴影
      //   expansionCallback: (index, bool) {
      //     setState(() {
      //       expandStateList[index].isOpen = !expandStateList[index].isOpen;
      //     });
      //   },
      //   children: expandStateList.map((e) {
      //     return ExpansionPanel(
      //         canTapOnHeader: true,
      //         headerBuilder: (context, isExpanded) {
      //           return Text(
      //             e.title,
      //           );
      //         },
      //         body: Text('内容'),
      //         isExpanded: e.isOpen);
      //   }).toList(),
      // ),
相关推荐
用户2181697049308 小时前
Flutter ClipPath
flutter
用户21816970493010 小时前
Flutter 折叠组件 ExpansionTile ExpansionPanelList
flutter
不羁的木木1 天前
给鸿蒙 App 增加用系统应用打开文件的能力 —— open_app_file 的鸿蒙使用指南
flutter·harmonyos
HouWan1 天前
Flutter: MediaQuery.of(context) 为什么可能拖慢页面?
android·flutter·ios
西西学代码2 天前
flutter---井字游戏
flutter
tushanxing2 天前
Day 2: 容器与单子布局基础
flutter
程序员老刘2 天前
跨平台开发地图 | 2026年9月
flutter·客户端
HouWan2 天前
Flutter iOS UISceneDelegate 迁移指南:理清新的 Scene 生命周期
flutter·ios·app
技术任我行XTing3 天前
【DFX系列】Flutter 鸿蒙应用外接纹理介绍及问题定位
flutter·harmonyos