Open andr2k opened 1 year ago
Seems like using BeamerBackButtonDispatcher with fallBackToBeamBack
set to false solves the issue to some extent:
IndexedStack(
index: currentIndex,
children: [
Beamer(
routerDelegate: routerDelegates[0],
backButtonDispatcher: BeamerBackButtonDispatcher(
delegate: routerDelegates[0],
fallbackToBeamBack: false,
),
),
Container(
color: Colors.blueAccent,
padding: const EdgeInsets.all(32.0),
child: Beamer(
routerDelegate: routerDelegates[1],
backButtonDispatcher: BeamerBackButtonDispatcher(
delegate: routerDelegates[1],
fallbackToBeamBack: false,
),
),
),
],
)
Hey @andr2k :wave: Thanks for creating an issue and sorry for my absence lately.
I can reproduce the bug and will try to find the root cause, which should give us an internal fix that doesn't require any workarounds in the example.
These back button dispatchers are always tricky... :thinking:
The error seems to be caused by routerDelegates[1]
not taking the priority properly during its update
call.
Describe the bug There is a bug in this example: (https://github.com/slovnicki/beamer/tree/master/examples/bottom_navigation_multiple_beamers)
When another tab is selected, the system back button affects the hidden tab's state
Beamer version:
master
,To Reproduce Steps to reproduce the behavior:
device-2023-05-17-125245.webm
Result The back button click affected the hidden tab: 'Books' shows the list of items instead of the previously selected item The tab was changed to 'Books' on step 6
Expected behavior Pressing the back button should affect only the current tab, it should not change the tab
Smartphone (please complete the following information):