乐闻世界logo
搜索文章和话题

How do you implement a custom transition between screens in Flutter?

浏览0
2024年8月6日 00:01

To implement a custom transition between screens, you can use the PageRouteBuilder class and provide a custom transitionBuilder function.

For example, to create a fade transition:

Image 06-04-23 at 11.05 PM_11zon.webp

Then, to use the custom transition, you can simply push the new route:

Navigator.of(context).push(FadeRoute(page: MyNewPage()));

标签:Flutter