Update ExpansionPanel example for the updated expansionCallback callback (#132837)

fixes [ExpansionPanelList can't expand/collapse on the latest stable/master
](https://github.com/flutter/flutter/issues/132759)

https://github.com/flutter/flutter/pull/128082 updated the `expansionCallback` and also the `ExpansionPanel` sample in the Flutter gallery but not the API example. 

This PR fixes the API example and adds tests.
This commit is contained in:
Taha Tesser
2023-08-21 23:13:22 +03:00
committed by GitHub
parent 505f9d8954
commit af79b4c7a3
3 changed files with 76 additions and 2 deletions

View File

@@ -67,7 +67,7 @@ class _ExpansionPanelListExampleState extends State<ExpansionPanelListExample> {
return ExpansionPanelList(
expansionCallback: (int index, bool isExpanded) {
setState(() {
_data[index].isExpanded = !isExpanded;
_data[index].isExpanded = isExpanded;
});
},
children: _data.map<ExpansionPanel>((Item item) {