mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Revert default value change
This commit is contained in:
parent
d83fa696c0
commit
b308dbd32a
@ -18,7 +18,7 @@ class PageTransitionsThemeApp extends StatelessWidget {
|
||||
// Defines the page transition animations used by MaterialPageRoute
|
||||
// for different target platforms.
|
||||
// Non-specified target platforms will default to
|
||||
// FadeForwardsPageTransitionBuilder().
|
||||
// ZoomPageTransitionsBuilder().
|
||||
pageTransitionsTheme: const PageTransitionsTheme(
|
||||
builders: <TargetPlatform, PageTransitionsBuilder>{
|
||||
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
|
||||
|
||||
@ -63,9 +63,9 @@ class MaterialPageRoute<T> extends PageRoute<T> with MaterialRouteTransitionMixi
|
||||
/// A mixin that provides platform-adaptive transitions for a [PageRoute].
|
||||
///
|
||||
/// {@template flutter.material.materialRouteTransitionMixin}
|
||||
/// For Android, the entrance transition for the page slides in from right to
|
||||
/// left and fades in while the exiting page slides out in the same direction
|
||||
/// and fades out. The exit transition is similar, but in reverse.
|
||||
/// For Android, the entrance transition for the page zooms in and fades in
|
||||
/// while the exiting page zooms out and fades out. The exit transition is similar,
|
||||
/// but in reverse.
|
||||
///
|
||||
/// For iOS, the page slides in from the right and exits in reverse. The page
|
||||
/// also shifts to the left in parallax when another page enters to cover it.
|
||||
@ -77,8 +77,8 @@ class MaterialPageRoute<T> extends PageRoute<T> with MaterialRouteTransitionMixi
|
||||
///
|
||||
/// * [PageTransitionsTheme], which defines the default page transitions used
|
||||
/// by the [MaterialRouteTransitionMixin.buildTransitions].
|
||||
/// * [FadeForwardsPageTransitionsBuilder], which is the default page transition
|
||||
/// used by the [PageTransitionsTheme].
|
||||
/// * [ZoomPageTransitionsBuilder], which is the default page transition used
|
||||
/// by the [PageTransitionsTheme].
|
||||
/// * [CupertinoPageTransitionsBuilder], which is the default page transition
|
||||
/// for iOS and macOS.
|
||||
mixin MaterialRouteTransitionMixin<T> on PageRoute<T> {
|
||||
|
||||
@ -1041,7 +1041,7 @@ class CupertinoPageTransitionsBuilder extends PageTransitionsBuilder {
|
||||
/// and delegates to [buildTransitions].
|
||||
///
|
||||
/// If a builder with a matching platform is not found, then the
|
||||
/// [FadeForwardsPageTransitionsBuilder] is used.
|
||||
/// [ZoomPageTransitionsBuilder] is used.
|
||||
///
|
||||
/// {@tool dartpad}
|
||||
/// This example shows a [MaterialApp] that defines a custom [PageTransitionsTheme].
|
||||
@ -1075,7 +1075,7 @@ class PageTransitionsTheme with Diagnosticable {
|
||||
}) : _builders = builders;
|
||||
|
||||
static const Map<TargetPlatform, PageTransitionsBuilder> _defaultBuilders = <TargetPlatform, PageTransitionsBuilder>{
|
||||
TargetPlatform.android: FadeForwardsPageTransitionsBuilder(),
|
||||
TargetPlatform.android: ZoomPageTransitionsBuilder(),
|
||||
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
|
||||
TargetPlatform.macOS: CupertinoPageTransitionsBuilder(),
|
||||
};
|
||||
@ -1110,7 +1110,7 @@ class PageTransitionsTheme with Diagnosticable {
|
||||
/// {@macro flutter.widgets.delegatedTransition}
|
||||
DelegatedTransitionBuilder? delegatedTransition(TargetPlatform platform) {
|
||||
final PageTransitionsBuilder matchingBuilder =
|
||||
builders[platform] ?? const FadeForwardsPageTransitionsBuilder();
|
||||
builders[platform] ?? const ZoomPageTransitionsBuilder();
|
||||
|
||||
return matchingBuilder.delegatedTransition;
|
||||
}
|
||||
@ -1189,7 +1189,7 @@ class _PageTransitionsThemeTransitionsState<T> extends State<_PageTransitionsThe
|
||||
|
||||
final PageTransitionsBuilder matchingBuilder = widget.builders[platform] ?? switch (platform) {
|
||||
TargetPlatform.iOS => const CupertinoPageTransitionsBuilder(),
|
||||
TargetPlatform.android || TargetPlatform.fuchsia || TargetPlatform.windows || TargetPlatform.macOS || TargetPlatform.linux => const FadeForwardsPageTransitionsBuilder(),
|
||||
TargetPlatform.android || TargetPlatform.fuchsia || TargetPlatform.windows || TargetPlatform.macOS || TargetPlatform.linux => const ZoomPageTransitionsBuilder(),
|
||||
};
|
||||
return matchingBuilder.buildTransitions<T>(
|
||||
widget.route,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user