buildItem method
Implementation
Widget buildItem(String key, int index, WeCollapseItem item) {
final List<Widget> children = [buildTitle(key, index, item)];
final bool open = activeIndex.indexOf(key) >= 0;
// 内容
children.add(AnimatedCrossFade(
firstChild: Container(),
secondChild: buildContent(open, index, item.child),
firstCurve: const Interval(0.0, 0.6, curve: Curves.fastOutSlowIn),
secondCurve: const Interval(0.4, 1.0, curve: Curves.fastOutSlowIn),
sizeCurve: Curves.fastOutSlowIn,
crossFadeState:
open ? CrossFadeState.showSecond : CrossFadeState.showFirst,
duration: Duration(milliseconds: widget.duration)));
return Column(children: children);
}