flutter-expandable
flutter-expandable copied to clipboard
How to Get ExpandablePanel Expanded Status?
As i wrote on title, i want catch the ExpandablePanel's expand status. Can i catch or how can i catch?
controller?.expanded
i found thanks 🙌
@barangungor Can you share it. I would like to know how to get the state of the panel, whether it's expanded or collapsed. Can you share your code if possible.
@udaykumaruking i used ExpandableController for my ExpandalePanel and i am changing "myController.expanded" to onTap's value. That's the code :
onTap: (val) {
setState (() {
myController.expanded=val;
});
}
@barangungor Thanks, a lot. If possible can you share the repo or entire code.
@udaykumaruking that's my code but you should revise to use
ExpandablePanel( onTap: (val) { _categoryRepo.catControllers.forEach( (element) => element.expanded = false); _categoryRepo.subCategory.forEach( (element) => element['selected'] = false); setState(() { _categoryRepo.subCategory[index]['selected'] = val; _categoryRepo.catControllers[index].expanded = val; }); }, controller: _categoryRepo.catControllers[index], collapsed: Container(), expanded: categoryPhotoContent( context, itemWidth, itemHeight, index))