kalismeras61 / flutter_page_transition

This is Flutter Page Transition Package
BSD 2-Clause "Simplified" License
471 stars 56 forks source link

Curves have no effect using leftToRight transition type? #43

Closed mattf80 closed 3 years ago

mattf80 commented 3 years ago

Running flutter 2.0.1

Steps to reproduce:

  1. Create new Flutter project
  2. Copy and paste example from the docs into main.dart
  3. Add a curve to one of the transitions:
    ElevatedButton(
              child: Text('Left To Right Transition Second Page'),
              onPressed: () {
                Navigator.push(
                  context,
                  PageTransition(
                    type: PageTransitionType.leftToRight,
                    curve: Curves.easeInCubic,
                    duration: Duration(milliseconds: 500),
                    child: SecondPage(),
                  ),
                );
              },
            ),

Expected behaviour: Page transition adapts to the curve provided

Actual behaviour: No curve or effect at all is applied, the page just slides in

I thought I was missing something (and I probably am!) but given that this is a direct clone of the docs example, was wondering if I can ask for a little help? Thanks,

mattf80 commented 3 years ago

Exploring the examples a bit more, it seems like the curves don't take effect if using PageTransitionType.leftToRight but they do if using PageTransitionType.leftToRightJoined - is that right?

kalismeras61 commented 3 years ago

You can use both of them

tomc128 commented 2 years ago

It seems like this issue isn't resolved. Using PageTransitionType.leftToRight or PageTransitionType.rightToLeft causes the curve property to be ignored. Setting it to PageTransitionType.leftToRightJoined or PageTransitionType.rightToLeftJoined fixes this and the curve is once again respected.