-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Question about issue during dialog close #131
Comments
Hi @kvo87 , thanks for reaching out with this question. My first attempt would be with a customization of the searchResultDisplayFn: ({ required List<Tuple3<int, DropdownMenuItem, bool>> itemsToDisplay, required ScrollController scrollController, required bool thumbVisibility, required Widget emptyListWidget, required void Function(int index, dynamic value, bool itemSelected) itemTapped, required Widget Function(DropdownMenuItem item, bool isItemSelected) displayItem, }) { return Expanded( child: Scrollbar( controller: scrollController, thumbVisibility: thumbVisibility, child: itemsToDisplay.length == 0 ? emptyListWidget : ListView.builder( controller: scrollController, itemBuilder: (context, index) { int itemIndex = itemsToDisplay[index].item1; DropdownMenuItem item = itemsToDisplay[index].item2; bool isItemSelected = itemsToDisplay[index].item3; return InkWell( onTap: () { itemTapped( itemIndex, item.value, isItemSelected, ); }, child: displayItem( item, isItemSelected, ), ); }, itemCount: itemsToDisplay.length, ), ), I would add the delay before the call to |
Hi @lcuis, thank you for the suggestion. As far as I understand
Following code works for me but I feel like it is a hack and would like to find better solution.
|
Hi @kvo87 , Thanks for your explanations and examples. I don't think there is any better option than the one you found at the moment and I agree it would be better to have a better way. Maybe some kind of optional delay before the pop call? I hope this can be implemented one day. Cheers. |
Hi! I'm getting error "This widget has been unmounted, so the State no longer has a context (and should be considered defunct)."
It appears that state is updated earlier then dialog is closed. The error disappears if I set 200ms delay for
screenCtrl.setBaseCurrency(value);
.Question: Is it possible to await until pop() function will be completed? or how o avoid this issue?
Here is my code:
The text was updated successfully, but these errors were encountered: