flutterdart

How can I disable all animation in a Flutter app?


I have a Flutter app that run on web and desktop. Is there a way I can disable all animations (e.g. scroll animations and routing to new page animations) from a single place in my code?


Solution

  • There is no way to disable Transition animations and Slide Animations on FLutter, but this a requested feature right now due to Flutter Web being a thing now.

    As a workaround, you can use the transition-duration property of PageRouteBuilder Widget.

     Navigator.pushReplacement(
          context, 
          PageRouteBuilder(
            pageBuilder: (context, animation1, animation2) => Page1(),
            transitionDuration: Duration(seconds: 0),
        ),
    );
    

    Although you will have to implement this on every Route Navigation you perform.