PersistentBottomNavBar
PersistentBottomNavBar copied to clipboard
Black screen when switching instantly
When switching between two bottom bar item instantly (before that animation ends) cause a black screen. Any idea how to fix?
Any possible solution found? Im stuck on this as well. Not suited for production.
J'ai le même problème.
When switching between two bottom bar item instantly (before that animation ends) cause a black screen. Any idea how to fix?
Hi! @Cagefighter0012 @OSonntag
The problem is on Offset(_animations[index]!.value, 0) on _animations[index]!.value, in the _buildScreen() method in lib/models/lib/models/persistent-nav-bar-scaffold.widget.dart
Do that:
1 - Change _animations [index] !. value to a static value, example: Offset (0, 0)
ou
2 - Change Transform.translate() above, for another example: Transform.rotate()
ou
3 - Remove all:
return shouldBuildTab[index]
? widget.tabBuilder(context, index)
: Container();
/*
return shouldBuildTab[index]
? (widget.screenTransitionAnimation!.animateTabTransition
? AnimatedBuilder(
animation: _animations[index]!,
builder: (context, child) => Transform.translate(
offset: Offset(_animations[index]!.value, 0),
child: widget.tabBuilder(context, index),
),
)
: widget.tabBuilder(context, index))
: Container();
*/
4 - etc
Quickest fix I've found for this is to just change the container colour from black to whatever suits you (persistent-nav-bar-scaffold.widget.dart, ln: 418).
Not that I'm endorsing changing code in imported packages or anything. That should not be done, ever. This really needs to be fixed in the package itself by the dev and published. With the best solution (IMHO) being to expose this as a setting for the devs.
Since this does have a simple solution, can we expect it to be fixed soon?
Same issue here, but the big problem is that sometimes it remains black, until a next tab change
Yeah this haven't been fixed since last year, @BilalShahid13 do you have time to take a look a it?
If the animation is disabled all is good, the black screen is gone, but it looks nice with the transition animation: In PersistentTabView's constructor, remove screenTransitionAnimation.
Any update?
Looking into it
Its fixed since version 4.1.6 over at https://github.com/jb3rndt/PersistentBottomNavBarV2