Text disappears after custom page transition

275 views Asked by At

I'm having this weird issue that when I navigate to a new route, a text I put on the destination page doesn't show. But other elements do.

here is the implementation on my transition:

class BouncyPageRoute extends PageRouteBuilder {
  final Widget destination;

  BouncyPageRoute({this.destination})
      : super(
          transitionDuration: Duration(milliseconds: 600),
          transitionsBuilder: (context, animation, secondaryAnimation, child) {
            animation =
                CurvedAnimation(parent: animation, curve: Curves.elasticInOut);
            return ScaleTransition(
              scale: animation,
              child: child,
              alignment: Alignment.center,
            );
          },
          pageBuilder: (context, animation, secondaryAnimation) {
            return destination;
          },
        );
}

The destination page implementation:

import 'package:flutter/material.dart';

class SecondScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
        child: Center(
          child: Column(
            children: [
              FlutterLogo(),
              Text(" can you see meeee??"),
            ],
          ),
        ),
      ),
    );
  }
}

you can checkout the project on github [email protected]:folivi/flutter_transition_issue.git I'm on the flutter 1.22 beta branch.

What I'm I doin't wrong?

thank you for your help

1

There are 1 answers

0
Eng Mghase On

I have the same problem when I set the transition duration to 2000, but it works when I set it at around 1500. So try to adjust the transition duration.