diff --git a/packages/flutter/lib/fix_data/fix_material/fix_material.yaml b/packages/flutter/lib/fix_data/fix_material/fix_material.yaml index fb8467c0c8..f11926a2d6 100644 --- a/packages/flutter/lib/fix_data/fix_material/fix_material.yaml +++ b/packages/flutter/lib/fix_data/fix_material/fix_material.yaml @@ -897,9 +897,9 @@ transforms: oldName: 'showTrackOnHover' newName: 'trackVisibility' - # Changes made in https://github.com/flutter/flutter/pull/129942 + # Changes made in https://github.com/flutter/flutter/pull/134417 - title: "Migrate to 'Easing.legacy'" - date: 2023-07-04 + date: 2023-12-12 element: uris: [ 'material.dart' ] variable: 'standardEasing' @@ -910,9 +910,9 @@ transforms: field: legacy inClass: Easing - # Changes made in https://github.com/flutter/flutter/pull/129942 + # Changes made in https://github.com/flutter/flutter/pull/134417 - title: "Migrate to 'Easing.legacyAccelerate'" - date: 2023-07-04 + date: 2023-12-12 element: uris: [ 'material.dart' ] variable: 'accelerateEasing' @@ -923,9 +923,9 @@ transforms: field: legacyAccelerate inClass: Easing - # Changes made in https://github.com/flutter/flutter/pull/129942 + # Changes made in https://github.com/flutter/flutter/pull/134417 - title: "Migrate to 'Easing.legacyDecelerate'" - date: 2023-07-04 + date: 2023-12-12 element: uris: [ 'material.dart' ] variable: 'decelerateEasing' diff --git a/packages/flutter/lib/src/material/curves.dart b/packages/flutter/lib/src/material/curves.dart index c267e3771e..3c465e5019 100644 --- a/packages/flutter/lib/src/material/curves.dart +++ b/packages/flutter/lib/src/material/curves.dart @@ -6,9 +6,7 @@ import 'package:flutter/animation.dart'; // The easing curves of the Material Library -// TODO(guidezpl): deprecate the three curves below once customers (packages/plugins) are migrated - -/// The standard easing curve in the Material specification. +/// The standard easing curve in the Material 2 specification. /// /// Elements that begin and end at rest use standard easing. /// They speed up quickly and slow down gradually, in order @@ -16,18 +14,28 @@ import 'package:flutter/animation.dart'; /// /// See also: /// * +@Deprecated( + 'Use Easing.legacy (M2) or Easing.standard (M3) instead. ' + 'This curve is updated in M3. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' +) const Curve standardEasing = Curves.fastOutSlowIn; -/// The accelerate easing curve in the Material specification. +/// The accelerate easing curve in the Material 2 specification. /// /// Elements exiting a screen use acceleration easing, /// where they start at rest and end at peak velocity. /// /// See also: /// * +@Deprecated( + 'Use Easing.legacyAccelerate (M2) or Easing.standardAccelerate (M3) instead. ' + 'This curve is updated in M3. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' +) const Curve accelerateEasing = Cubic(0.4, 0.0, 1.0, 1.0); -/// The decelerate easing curve in the Material specification. +/// The decelerate easing curve in the Material 2 specification. /// /// Incoming elements are animated using deceleration easing, /// which starts a transition at peak velocity (the fastest @@ -35,4 +43,9 @@ const Curve accelerateEasing = Cubic(0.4, 0.0, 1.0, 1.0); /// /// See also: /// * +@Deprecated( + 'Use Easing.legacyDecelerate (M2) or Easing.standardDecelerate (M3) instead. ' + 'This curve is updated in M3. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' +) const Curve decelerateEasing = Cubic(0.0, 0.0, 0.2, 1.0); diff --git a/packages/flutter/test_fixes/material/material.dart b/packages/flutter/test_fixes/material/material.dart index 3afb419e54..48928a96f8 100644 --- a/packages/flutter/test_fixes/material/material.dart +++ b/packages/flutter/test_fixes/material/material.dart @@ -318,11 +318,10 @@ void main() { ); final Clip clip = details.clipBehavior; - // Changes made in https://github.com/flutter/flutter/pull/129942 - // TODO(guidezpl): enable fix after https://github.com/dart-lang/sdk/issues/52902 - // const Curve curve = standardEasing; expect Easing.legacy - // const Curve curve = accelerateEasing; expect Easing.legacyAccelerate - // const Curve curve = decelerateEasing; expect Easing.legacyDecelerate + // Changes made in https://github.com/flutter/flutter/pull/134417 + const Curve curve = standardEasing; + const Curve curve = accelerateEasing; + const Curve curve = decelerateEasing; final PlatformMenuBar platformMenuBar = PlatformMenuBar(menus: [], body: const SizedBox()); final Widget bodyValue = platformMenuBar.body; diff --git a/packages/flutter/test_fixes/material/material.dart.expect b/packages/flutter/test_fixes/material/material.dart.expect index 1c475a47f5..fc8f42404e 100644 --- a/packages/flutter/test_fixes/material/material.dart.expect +++ b/packages/flutter/test_fixes/material/material.dart.expect @@ -314,11 +314,10 @@ void main() { ); final Clip clip = details.decorationClipBehavior; - // Changes made in https://github.com/flutter/flutter/pull/129942 - // TODO(guidezpl): enable fix after https://github.com/dart-lang/sdk/issues/52902 - // const Curve curve = standardEasing; expect Easing.legacy - // const Curve curve = accelerateEasing; expect Easing.legacyAccelerate - // const Curve curve = decelerateEasing; expect Easing.legacyDecelerate + // Changes made in https://github.com/flutter/flutter/pull/134417 + const Curve curve = Easing.legacy; + const Curve curve = Easing.legacyAccelerate; + const Curve curve = Easing.legacyDecelerate; final PlatformMenuBar platformMenuBar = PlatformMenuBar(menus: [], child: const SizedBox()); final Widget bodyValue = platformMenuBar.child;