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 Have Unique Controllers in ListView.Builder(Loop of Widgets) #37

Open
BensonKarue opened this issue Jul 12, 2023 · 2 comments
Open

Comments

@BensonKarue
Copy link

Using the controller on the ListView.builder makes all the popups to be shown at the same time when one item in the list is clicked. How do I make sure I have that each and every item in the list view has a unique controller? Many thanks

@SunLees
Copy link

SunLees commented Dec 12, 2023

Widget _buildItemLayout(int index){ CustomPopupMenuController popupMenuController = CustomPopupMenuController();//弹出菜单控制器 //其他代码.... }
然后把controller给PopUpMenu就可以了。希望可以帮助到你。

@Junesui
Copy link

Junesui commented Aug 24, 2024

Widget _buildItemLayout(int index){ CustomPopupMenuController popupMenuController = CustomPopupMenuController();//弹出菜单控制器 //其他代码.... } 然后把controller给PopUpMenu就可以了。希望可以帮助到你。

很多item的话,会创建很多controller,确定内存没问题吗

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