# Page transition builders reorganization

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




:::important
These breaking change docs are accurate, as of the release
under which they are published. Over time, the
workarounds described here might become inaccurate.
We don't, in general, keep these breaking change docs up
to date as of each release.

这些破坏性改动文档的准确性仅限于其发布时对应的版本。
随着时间的推移，文档中描述的方案可能会逐渐失效。
通常情况下，我们不会在每次发布新版本时都对这些文档进行同步更新。

The [breaking change index file](/release/breaking-changes)
lists the docs created for each release.

[破坏性改动列表](/release/breaking-changes) 
列出了每个版本的文档。

:::


## Summary

`CupertinoPageTransitionsBuilder` has been relocated from
`package:flutter/material.dart` to `package:flutter/cupertino.dart`.

## Background

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

The available page transition builders are:

| Builder | Library | Description |
|---------|---------|-------------|
| `FadeUpwardsPageTransitionsBuilder` | Material | Default transition before Material 3 |
| `OpenUpwardsPageTransitionsBuilder` | Material | Vertical slide transition |
| `ZoomPageTransitionsBuilder` | Material | Zoom transition (Material 3 default) |
| `PredictiveBackPageTransitionsBuilder` | Material | Android predictive back gesture support |
| `CupertinoPageTransitionsBuilder` | **Cupertino** | iOS-style horizontal slide transition |

{:.table}

Previously, `CupertinoPageTransitionsBuilder` was defined in
the Material library alongside the other builders.
This class is semantically a Cupertino component because
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 use `CupertinoPageTransitionsBuilder` and
only import `package:flutter/material.dart`,
add an import for `package:flutter/cupertino.dart`.

Code before migration:

```dart
import 'package:flutter/material.dart';

final pageTransitionsTheme = PageTransitionsTheme(
  builders: {
    TargetPlatform.android: ZoomPageTransitionsBuilder(),
    TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
  },
);
```

Code after migration:

```dart
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

final pageTransitionsTheme = PageTransitionsTheme(
  builders: {
    TargetPlatform.android: ZoomPageTransitionsBuilder(),
    TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
  },
);
```

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

## Timeline

Landed in version: 3.43.0-0.1.pre<br>
In stable release: 3.44

## References

Relevant PRs:

* [Decouple CupertinoPageTransitionsBuilder from Material][pr-179776]

[pr-179776]: https://github.com/flutter/flutter/pull/179776

