PersistentBottomNavBarV2 icon indicating copy to clipboard operation
PersistentBottomNavBarV2 copied to clipboard

Animation types when switching tabs

Open alanchan-dev opened this issue 3 years ago • 2 comments

Hi, thanks for continuing this package. Is there a way to use different screen transition animation? (ex: Fade/Zoom) Currently it's sliding left/right when tapping on the tabs.

alanchan-dev avatar Apr 01 '22 06:04 alanchan-dev

No sorry, currently it is not possible.

jb3rndt avatar Apr 02 '22 13:04 jb3rndt

Update: there is a way to change the transition if you dont rely on stateManagement: https://github.com/jb3rndt/PersistentBottomNavBarV2/issues/38

jb3rndt avatar Jun 21 '22 16:06 jb3rndt

@jb3rndt I'm wondering if you have come up with any solution or implementation that makes the other transitions possible without losing the state as of today. our app relies on stateManagement and we need to have fade transition between pages for both iOS and Android

ZahraVe avatar Apr 13 '23 14:04 ZahraVe

Hi, yes! You can find animatedTabBuilder in version 5.0.0-beta.5. Here is an example on how to use this callback for a translation transition (which is the default):

final double yOffset = newIndex > index
     ? -animationValue
     : (newIndex < index
         ? animationValue
        : (index < oldIndex ? animationValue - 1 : 1 - animationValue));
  return FractionalTranslation(
   translation: Offset(yOffset, 0),
    child: child,
  );

It should work with a fade too.

jb3rndt avatar Jul 03 '23 19:07 jb3rndt