arthurbcd / go_transitions

MIT License
2 stars 1 forks source link

Reveal Transition #1

Closed jtkeyva closed 2 months ago

jtkeyva commented 7 months ago

Hi this is a good idea thanks for the package. Do you have plans for a "reveal" transition? Where the next page is revealed aka, the existing page animates off the stack and the next page is already in position. thanks

jtkeyva commented 7 months ago

Actually your .slide transition is almost exactly what i'm looking for...but if it did the opposite. Right now it slides a new page OVER/on top of the current page. But when you go back it "reveals" just as i would like.

Is there a way to specify slide over or slide under when navigating TO a page?

Like a deck of cards :)

arthurbcd commented 7 months ago

Sorry for the late response!

Did you try GoTransitions.slide.toTop or toBottom?

You can also try the properties by doing:

pagebuilder: GoTransition(
axis: ...,
alignment: ...,
);

Having inverted behavior is an interesting suggestion for a modifier.

I'll see what I can do for this reveal transition.

Thanks for the suggestion! :)

jtkeyva commented 7 months ago

thanks for the prompt response! yes toTop isn't quite what i'm looking for.

imagine like a deck/stack of cards. the top card is the current page. slide the top card off to reveal the card beneath (the next page)

Sort of like this but without the rotating of the card...just like a slide but it "reveals" the page below

https://pub.dev/packages/flutter_card_swiper https://pub.dev/packages/swipeable_card_stack

Also, if you simply use your slide.toLeft and then pop the page back... THAT is what I am looking for. Does that make sense?

arthurbcd commented 7 months ago

Oh, I understand it better now.

I will absolutely work on this and give you an update this weekend.

Thanks for the clarifications and links!

jtkeyva commented 7 months ago

Wow awesome! I think this will be a great addition to your transition options for many to enjoy :)

arthurbcd commented 7 months ago

New update! 0.5.0

  1. Add the new GoTransition.observer:

    GoRouter( // or ShellRoute etc
    observers: [GoTransition.observer],
    )
  2. Use the transition:

  GoRoute(
      path: 'slide',
      builder: (_, __) => const HomePage(),
      pageBuilder: GoTransitions.slide.toRight.onPrevious,
  ),

Hope this achieves what you were looking for!

jtkeyva commented 7 months ago

Hey thanks a lot! Yes the slide example is just what i wanted. I'm not sure .onPrevious name makes sense though. i would just call it reveal rather than slide. because it is revealing the next slide.

I would consider renaming the size transition...it's not really sizing anything, it's just closing like an eye, almost like a blink of an eye. if it was "closing" horizontally i would call it a curtain.

have you ever considered a circle / hole transition? that would be really cool too :)