toggleExpansion method
Implementation
void toggleExpansion(int index) {
if (expandedItems.contains(index)) {
expandedItems.remove(index);
print("Collapsed: $index");
} else {
expandedItems.add(index);
print("Expanded: $index");
}
print("Expanded Items: $expandedItems");
}