Skip to content

Commit

Permalink
Fix tabs overlaying each other if no transition animation should be s…
Browse files Browse the repository at this point in the history
…hown
  • Loading branch information
jb3rndt committed Mar 28, 2024
1 parent 59c99e6 commit f64f217
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import "package:example/interactive_example.dart";
import "package:example/screens.dart";
import "package:flutter/material.dart";
import "package:flutter/services.dart";
import "package:persistent_bottom_nav_bar_v2/persistent_bottom_nav_bar_v2.dart";
import "package:example/interactive_example.dart";
import "package:example/screens.dart";

void main() {
WidgetsFlutterBinding.ensureInitialized();
Expand Down
4 changes: 3 additions & 1 deletion lib/components/persistent_tab_view_scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,9 @@ class _TabSwitchingViewState extends State<_TabSwitchingView>
fit: StackFit.expand,
children: List<Widget>.generate(widget.tabCount, (index) {
final bool active = index == _currentTabIndex ||
(!_animation.isCompleted && index == _previousTabIndex);
(!_animation.isCompleted &&
index == _previousTabIndex &&
_showAnimation);
shouldBuildTab[index] =
active || (shouldBuildTab[index] && widget.stateManagement);

Expand Down

0 comments on commit f64f217

Please sign in to comment.