jb3rndt / PersistentBottomNavBarV2

A highly customizable persistent bottom navigation bar for Flutter
https://pub.dev/packages/persistent_bottom_nav_bar_v2
BSD 3-Clause "New" or "Revised" License
49 stars 56 forks source link

[Bug]: No page transition animation when using go_router and changing tabs #183

Open danut007ro opened 1 month ago

danut007ro commented 1 month ago

Version

5.3.1

Flutter Doctor Output

[✓] Flutter (Channel stable, 3.24.3, on macOS 14.6.1 23G93 darwin-arm64, locale en-RO)
    • Flutter version 3.24.3 on channel stable at /Users/danut007ro/Dev/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2663184aa7 (5 weeks ago), 2024-09-11 16:27:48 -0500
    • Engine revision 36335019a8
    • Dart version 3.5.3
    • DevTools version 2.37.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/danut007ro/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Users/danut007ro/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16A242d
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.2)
    • Android Studio at /Users/danut007ro/Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)

[✓] VS Code (version 1.91.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (4 available)
    • sdk gphone64 arm64 (mobile)     • emulator-5554         • android-arm64  • Android 13 (API 33) (emulator)
    • macOS (desktop)                 • macos                 • darwin-arm64   • macOS 14.6.1 23G93 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin         • macOS 14.6.1 23G93 darwin-arm64
    • Chrome (web)                    • chrome                • web-javascript • Google Chrome 129.0.6668.91

[✓] Network resources
    • All expected network resources are available.

• No issues found!

What platforms are you seeing the problem on?

Android

What happened?

When using go_router and switching tabs I see no page transition animation. Is this expected?

Steps to reproduce

  1. Switch tab
  2. Se no page transition animation

Code to reproduce the problem

I'm using https://github.com/jb3rndt/PersistentBottomNavBarV2/blob/master/example/lib/go_router_example.dart

Relevant log output

No response

Screenshots

No response

jb3rndt commented 1 month ago

Hi, I have not tried it out but I think in the StatefulShellRoute.indexedStack, you would need to adjust the GoRoute of each of your

StatefulShellBranch(
  routes: <RouteBase>[
    GoRoute(
      path: "settings",
      builder: (context, state) => const MainScreen(
        useRouter: true,
      ),
      routes: [subRoutes],
    ),
  ],
),

according to this: https://pub.dev/documentation/go_router/latest/topics/Transition%20animations-topic.html