Transition animation in Fluttter

The default page transition animation of Flutter Android is to open from the bottom up. Now many android systems also slide left and right when opening the default page. We can also see the left and right sliding effect on Flutter ios.

It's very simple, we just need to change the theme and set the default transition animation

ThemeData(
   // platform: TargetPlatform.iOS, //这种方式指定了操作平台
   //pageTransitionsTheme 它定义整个主题的默认页面过渡。

    pageTransitionsTheme: PageTransitionsTheme(
      builders: {
        TargetPlatform.android: CupertinoPageTransitionsBuilder(),
        TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
      }
    ),
}

The effect is as follows:

 

Guess you like

Origin blog.csdn.net/MrLizuo/article/details/127617026