Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

docs.flutter.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.

Learn more

Flutter 3.41 is live! Check out theFlutter 3.41 blog post!

Page transition builders reorganization

CupertinoPageTransitionsBuilder has been moved from the Material library to the Cupertino library where it belongs.

Important

Summary

#

CupertinoPageTransitionsBuilder has been relocated frompackage:flutter/material.dart topackage:flutter/cupertino.dart.

Background

#

Flutter provides several page transition builders that control how routes animate when navigating between pages. These builders are used withPageTransitionsTheme to customize transitions per platform.

The available page transition builders are:

BuilderLibraryDescription
FadeUpwardsPageTransitionsBuilderMaterialDefault pre-Material 3 transition
OpenUpwardsPageTransitionsBuilderMaterialVertical slide transition
ZoomPageTransitionsBuilderMaterialZoom transition (Material 3 default)
PredictiveBackPageTransitionsBuilderMaterialAndroid predictive back gesture support
CupertinoPageTransitionsBuilderCupertinoiOS-style horizontal slide transition

Previously,CupertinoPageTransitionsBuilder was defined in the Material library alongside the other builders. However, this class is semantically a Cupertino component—its implementation uses Cupertino transition mixins and provides iOS-style navigation animations.

This move improves code organization and allows Cupertino apps to use this builder without depending on the Material library.

Migration guide

#

If you useCupertinoPageTransitionsBuilder and only importpackage:flutter/material.dart, add an import forpackage:flutter/cupertino.dart.

Code before migration:

dart
import'package:flutter/material.dart';finalpageTransitionsTheme=PageTransitionsTheme(builders:{TargetPlatform.android:ZoomPageTransitionsBuilder(),TargetPlatform.iOS:CupertinoPageTransitionsBuilder(),},);

Code after migration:

dart
import'package:flutter/cupertino.dart';import'package:flutter/material.dart';finalpageTransitionsTheme=PageTransitionsTheme(builders:{TargetPlatform.android:ZoomPageTransitionsBuilder(),TargetPlatform.iOS:CupertinoPageTransitionsBuilder(),},);

If your app already imports both packages, no changes are needed.

Timeline

#

Landed in version: Not yet released
In stable release: Not yet released

References

#

Relevant PRs:

Was this page's content helpful?

Unless stated otherwise, the documentation on this site reflects Flutter 3.38.6. Page last updated on 2026-01-12.View source orreport an issue.


[8]ページ先頭

©2009-2026 Movatter.jp