Closed bugrevealingbme closed 3 months ago
I'm seeing a similar error
======== Exception caught by widgets library =======================================================
The following assertion was thrown while finalizing the widget tree:
'package:flutter/src/widgets/framework.dart': Failed assertion: line 5013 pos 12: '_lifecycleState != _ElementLifecycle.defunct': is not true.
as caught by crashalytics
I/flutter (27193): 'package:flutter/src/widgets/framework.dart': Failed assertion: line 5013 pos 12: '_lifecycleState != _ElementLifecycle.defunct': is not true.
I/flutter (27193): #0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
I/flutter (27193): #1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
I/flutter (27193): #2 Element.markNeedsBuild (package:flutter/src/widgets/framework.dart:5013:12)
I/flutter (27193): #3 State.setState (package:flutter/src/widgets/framework.dart:1223:15)
When a user is on my "home page" and uses the android hardward button to go back.
I suspect it's the same issue even if caused by a different route. Trying to go back from the home page/start point
Edit: So I took PersistentTabView
out of my "tree" and hitting back soft/hard key now "exits" the app and goes to phone desktop, (as in instead of PersistentTabView
with my tabs I call my Home
page builder)
Where as with PersistentTabView
in the tree it crashes to blackscreen instaed of "exit"ing.
Edit 2:
if I "hot reload" whilst in the "blackscreen crashed state":
The following assertion was thrown building Navigator-[GlobalObjectKey<NavigatorState> _WidgetsAppState#1f9c3](dirty, dependencies: [HeroControllerScope, UnmanagedRestorationScope], state: NavigatorState#90502(tickers: tracking 1 ticker)):
'package:flutter/src/widgets/navigator.dart': Failed assertion: line 5535 pos 12: '_history.isNotEmpty': is not true.
Edit 3: I also tried to use PopScope
to block the softkey working and it doesn't work when navbar in use
Edit 4: I solved my MEGA ERROR (I have setState on somethign that can't be setState'd when in the blackscreen) but I still get a black screen when usign the back button to a page that shouldn't exist. But only exists when PersistentNavTree is in the stack.
So my mega error is as a result of the extra "page" that exists to navigate back to that can't be blocked with popscope. This might need a seperate issue to track
Thanks for reporting. Closing this as duplicate of https://github.com/jb3rndt/PersistentBottomNavBarV2/issues/139. @bugrevealingbme if you still have issues not covered by https://github.com/jb3rndt/PersistentBottomNavBarV2/issues/139 feel free to open a new issue.
This bug has been fixed but there is another problem. If we pop on the first page it goes to the old tab. I don't want this to happen
You can set handleAndroidBackButtonPress = false
which should disable that. More fine grained control for that is currently worked on (see https://github.com/jb3rndt/PersistentBottomNavBarV2/pull/138).
If that doesnt help, please open a new issue.
You can set
handleAndroidBackButtonPress = false
which should disable that. More fine grained control for that is currently worked on (see #138). If that doesnt help, please open a new issue.
If I make it False, going back with .pop does not work
════════ Exception caught by gesture ═══════════════════════════════════════════ The following GoError was thrown while handling a gesture: There is nothing to pop
I havent worked with go_router that much, so I dont know where the origin for this problem is located. Again, please open a new issue and provide the information required in the form (especially a minimal reproducible code example) to make debugging possible.
I havent worked with go_router that much, so I dont know where the origin for this problem is located. Again, please open a new issue and provide the information required in the form (especially a minimal reproducible code example) to make debugging possible.
Actually, the problem is just that pop is changing the page. This problem didn't exist before. It came 2 versions ago. This is the problem we need to focus on, I can't make handleAndroidBackButtonPress = false because I use
Package Version (from pubspec.yaml): persistent_bottom_nav_bar_v2: ^5.1.0
I had made such a code. If no tab has changed after opening the application, the application breaks. It happened after the last version.