Unverified Commit ef5beece authored by Pierre-Louis's avatar Pierre-Louis Committed by GitHub

Deprecate M2 curves (#134417)

These have 1:1 replacements with a new name, introduced in
https://github.com/flutter/flutter/pull/129942

Land after https://github.com/flutter/packages/pull/4898

Part of https://github.com/flutter/flutter/issues/116525

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
parent cd06ba7a
...@@ -897,9 +897,9 @@ transforms: ...@@ -897,9 +897,9 @@ transforms:
oldName: 'showTrackOnHover' oldName: 'showTrackOnHover'
newName: 'trackVisibility' 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'" - title: "Migrate to 'Easing.legacy'"
date: 2023-07-04 date: 2023-12-12
element: element:
uris: [ 'material.dart' ] uris: [ 'material.dart' ]
variable: 'standardEasing' variable: 'standardEasing'
...@@ -910,9 +910,9 @@ transforms: ...@@ -910,9 +910,9 @@ transforms:
field: legacy field: legacy
inClass: Easing 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'" - title: "Migrate to 'Easing.legacyAccelerate'"
date: 2023-07-04 date: 2023-12-12
element: element:
uris: [ 'material.dart' ] uris: [ 'material.dart' ]
variable: 'accelerateEasing' variable: 'accelerateEasing'
...@@ -923,9 +923,9 @@ transforms: ...@@ -923,9 +923,9 @@ transforms:
field: legacyAccelerate field: legacyAccelerate
inClass: Easing 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'" - title: "Migrate to 'Easing.legacyDecelerate'"
date: 2023-07-04 date: 2023-12-12
element: element:
uris: [ 'material.dart' ] uris: [ 'material.dart' ]
variable: 'decelerateEasing' variable: 'decelerateEasing'
......
...@@ -6,9 +6,7 @@ import 'package:flutter/animation.dart'; ...@@ -6,9 +6,7 @@ import 'package:flutter/animation.dart';
// The easing curves of the Material Library // 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 2 specification.
/// The standard easing curve in the Material specification.
/// ///
/// Elements that begin and end at rest use standard easing. /// Elements that begin and end at rest use standard easing.
/// They speed up quickly and slow down gradually, in order /// They speed up quickly and slow down gradually, in order
...@@ -16,18 +14,28 @@ import 'package:flutter/animation.dart'; ...@@ -16,18 +14,28 @@ import 'package:flutter/animation.dart';
/// ///
/// See also: /// See also:
/// * <https://material.io/design/motion/speed.html#easing> /// * <https://material.io/design/motion/speed.html#easing>
@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; 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, /// Elements exiting a screen use acceleration easing,
/// where they start at rest and end at peak velocity. /// where they start at rest and end at peak velocity.
/// ///
/// See also: /// See also:
/// * <https://material.io/design/motion/speed.html#easing> /// * <https://material.io/design/motion/speed.html#easing>
@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); 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, /// Incoming elements are animated using deceleration easing,
/// which starts a transition at peak velocity (the fastest /// 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); ...@@ -35,4 +43,9 @@ const Curve accelerateEasing = Cubic(0.4, 0.0, 1.0, 1.0);
/// ///
/// See also: /// See also:
/// * <https://material.io/design/motion/speed.html#easing> /// * <https://material.io/design/motion/speed.html#easing>
@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); const Curve decelerateEasing = Cubic(0.0, 0.0, 0.2, 1.0);
...@@ -318,11 +318,10 @@ void main() { ...@@ -318,11 +318,10 @@ void main() {
); );
final Clip clip = details.clipBehavior; final Clip clip = details.clipBehavior;
// Changes made in https://github.com/flutter/flutter/pull/129942 // Changes made in https://github.com/flutter/flutter/pull/134417
// TODO(guidezpl): enable fix after https://github.com/dart-lang/sdk/issues/52902 const Curve curve = standardEasing;
// const Curve curve = standardEasing; expect Easing.legacy const Curve curve = accelerateEasing;
// const Curve curve = accelerateEasing; expect Easing.legacyAccelerate const Curve curve = decelerateEasing;
// const Curve curve = decelerateEasing; expect Easing.legacyDecelerate
final PlatformMenuBar platformMenuBar = PlatformMenuBar(menus: <PlatformMenuItem>[], body: const SizedBox()); final PlatformMenuBar platformMenuBar = PlatformMenuBar(menus: <PlatformMenuItem>[], body: const SizedBox());
final Widget bodyValue = platformMenuBar.body; final Widget bodyValue = platformMenuBar.body;
......
...@@ -314,11 +314,10 @@ void main() { ...@@ -314,11 +314,10 @@ void main() {
); );
final Clip clip = details.decorationClipBehavior; final Clip clip = details.decorationClipBehavior;
// Changes made in https://github.com/flutter/flutter/pull/129942 // Changes made in https://github.com/flutter/flutter/pull/134417
// TODO(guidezpl): enable fix after https://github.com/dart-lang/sdk/issues/52902 const Curve curve = Easing.legacy;
// const Curve curve = standardEasing; expect Easing.legacy const Curve curve = Easing.legacyAccelerate;
// const Curve curve = accelerateEasing; expect Easing.legacyAccelerate const Curve curve = Easing.legacyDecelerate;
// const Curve curve = decelerateEasing; expect Easing.legacyDecelerate
final PlatformMenuBar platformMenuBar = PlatformMenuBar(menus: <PlatformMenuItem>[], child: const SizedBox()); final PlatformMenuBar platformMenuBar = PlatformMenuBar(menus: <PlatformMenuItem>[], child: const SizedBox());
final Widget bodyValue = platformMenuBar.child; final Widget bodyValue = platformMenuBar.child;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment