flutter-expandable icon indicating copy to clipboard operation
flutter-expandable copied to clipboard

How to Get ExpandablePanel Expanded Status?

Open barangungor opened this issue 3 years ago • 6 comments

As i wrote on title, i want catch the ExpandablePanel's expand status. Can i catch or how can i catch?

barangungor avatar May 12 '21 11:05 barangungor

controller?.expanded

noveleven avatar May 20 '21 17:05 noveleven

i found thanks 🙌

barangungor avatar May 20 '21 18:05 barangungor

@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 avatar Oct 11 '21 11:10 udaykumaruking

@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 avatar Oct 11 '21 11:10 barangungor

@barangungor Thanks, a lot. If possible can you share the repo or entire code.

udaykumaruking avatar Oct 11 '21 12:10 udaykumaruking

@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))

barangungor avatar Oct 11 '21 12:10 barangungor