Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Get ExpandablePanel Expanded Status? #100

Open
barangungor opened this issue May 12, 2021 · 6 comments
Open

How to Get ExpandablePanel Expanded Status? #100

barangungor opened this issue May 12, 2021 · 6 comments

Comments

@barangungor
Copy link

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

@barangungor barangungor changed the title How to Get ExpandablePanel is Expanded? How to Get ExpandablePanel Expanded Status? May 12, 2021
@noveleven
Copy link

controller?.expanded

@barangungor
Copy link
Author

i found thanks 🙌

@udaykumaruking
Copy link

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

@barangungor
Copy link
Author

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

@udaykumaruking
Copy link

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

@barangungor
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants