onClick method
Implementation
void onClick(String key) {
List<String> activeList = activeIndex;
if (activeList.indexOf(key) >= 0) {
activeList.remove(key);
} else {
// 手风琴模式判断
if (widget.accordion) {
activeList = [key];
} else {
activeList.add(key);
}
}
setState(() {
activeIndex = activeList;
});
if (widget.onChange is Function) widget.onChange!(activeList);
}