salim-lachdhaf / dropdown_search

Simple and robust Dropdown with item search feature, making it possible to use an offline item list or filtering URL for easy customization.
MIT License
341 stars 330 forks source link

Close popup issue #702

Open Tigran-Kosemyan opened 6 days ago

Tigran-Kosemyan commented 6 days ago

After update the latest version, use same logic with new changes, I get this error when dropdown opened and I go to another page , in previous version used same logic but I don't have this issue

The following assertion was thrown while finalizing the widget tree: You have popped the last page off of the stack, there are no pages left to show 'package:go_router/src/delegate.dart': Failed assertion: line 119 pos 7: 'currentConfiguration.isNotEmpty'

When the exception was thrown, this was the stack:

2 GoRouterDelegate._debugAssertMatchListNotEmpty (package:go_router/src/delegate.dart:119:7)

3 GoRouterDelegate._completeRouteMatch. (package:go_router/src/delegate.dart:165:7)

4 GoRouterDelegate._completeRouteMatch (package:go_router/src/delegate.dart:167:6)

5 GoRouterDelegate._handlePopPageWithRouteMatch (package:go_router/src/delegate.dart:135:7)

6 _CustomNavigatorState._handlePopPage (package:go_router/src/builder.dart:416:42)

7 NavigatorState.pop (package:flutter/src/widgets/navigator.dart:5357:28)

8 Navigator.pop (package:flutter/src/widgets/navigator.dart:2665:27)

9 DropdownSearchPopupState.closePopup (package:dropdown_search/src/widgets/dropdown_search_popup.dart:781:34)

10 DropdownSearchState.dispose (package:dropdown_search/dropdown_search.dart:773:34)

11 StatefulElement.unmount (package:flutter/src/widgets/framework.dart:5826:11)

465 more (elided 2 frames from class _AssertionError)

salim-lachdhaf commented 6 days ago

Have you a reproducible simple code ? because from the log it seems there is an issue with your Navigation package.

Tigran-Kosemyan commented 4 days ago

Have you a reproducible simple code ? because from the log it seems there is an issue with your Navigation package.

I have StatefulNavigationShell and NavigationRail, using gorouter

void _goBranch(int index) { navigationShell.goBranch( index, initialLocation: true, ); }

After updating a package in my Flutter project, my app crashes under specific conditions. I have a parent screen that navigates to a second screen. In this second screen, I open a dropdown. When I click on the navigation rail to navigate to a different page (using initialLocation), the app crashes with an error.

Before updating the package, everything worked correctly. However, I need this update, and now the app crashes when navigating away from the second screen with an open dropdown.