Skip to content

refactor: Migrate Expansible animation properties to AnimationStyle for a less broad API surface#177966

Merged
auto-submit[bot] merged 3 commits into
flutter:masterfrom
rkishan516:expansible-animation-style
Nov 11, 2025
Merged

refactor: Migrate Expansible animation properties to AnimationStyle for a less broad API surface#177966
auto-submit[bot] merged 3 commits into
flutter:masterfrom
rkishan516:expansible-animation-style

Conversation

@rkishan516

Copy link
Copy Markdown
Contributor

Changes

  • Add animationStyle to Exapnsible
  • Mark duration, curve and reverseCurve as deprecated
  • Add data driven fixes

fixes: #177799

Pre-launch Checklist

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

@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. a: animation Animation APIs c: tech-debt Technical debt, code quality, testing, etc. labels Nov 4, 2025

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the Expansible widget to use AnimationStyle for its animation properties, deprecating the older duration, curve, and reverseCurve properties. This change aligns Expansible with other Flutter widgets and aims for a cleaner API surface. The implementation includes the necessary widget updates, data-driven fixes for smooth user migration, and new tests. My review found a couple of areas for improvement: the documentation for the new animationStyle property is confusing and contains an error, and a test case could be made more explicit to better reflect its purpose. Overall, this is a good refactoring that improves API consistency.

Comment on lines +264 to +266
/// If [AnimationStyle.duration] or [AnimationStyle.reverseDuration] is
/// provided, it will be used to override [duration]. If it is null, then
/// [duration] will be used. Otherwise, defaults to 200ms.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This documentation paragraph is confusing and contains an error. It incorrectly mentions AnimationStyle.reverseDuration, which is not used by Expansible. The phrasing with If it is null and Otherwise is also ambiguous.

Please consider rephrasing for clarity. The following paragraphs for curve and reverseCurve have similar clarity issues.

  /// If [AnimationStyle.duration] is provided, it will be used instead of
  /// [duration]. If not provided, [duration] is used, which defaults to
  /// 200ms.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an interesting question. I wonder, should Expansible support reverse duration? Maybe for closing? Or would that potentially be confusing based on the initial state?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does have a reverse curve, so I guess reverse duration would apply in that scenario. Probably good to consider as a separate change rather than lumped with this one. :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will update comment here and add reverseDuration in upcoming PR(if required).

Comment on lines +420 to +422
testWidgets('AnimationStyle takes precedence over deprecated properties', (
WidgetTester tester,
) async {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This test is correctly named 'AnimationStyle takes precedence over deprecated properties', but it only implicitly tests this by checking that animationStyle overrides the default values of the deprecated properties. To make the test's intent more explicit and robust, consider explicitly passing values for the deprecated duration and curve properties in the Expansible constructor and asserting they are ignored.

@rkishan516 rkishan516 force-pushed the expansible-animation-style branch from 1fb8a30 to 462c61f Compare November 4, 2025 05:13

@victorsanni victorsanni left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linux analyze is failing because packages/flutter/test_fixes/widgets/widgets.dart isn't formatted correctly.

@rkishan516 rkishan516 force-pushed the expansible-animation-style branch 2 times, most recently from 89fe6a2 to 382c2f2 Compare November 5, 2025 01:20
@rkishan516 rkishan516 force-pushed the expansible-animation-style branch from 382c2f2 to 35baecd Compare November 6, 2025 01:42
@victorsanni victorsanni self-requested a review November 6, 2025 19:21

@Piinks Piinks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 11, 2025
@auto-submit auto-submit Bot added this pull request to the merge queue Nov 11, 2025
Merged via the queue into flutter:master with commit e5f799a Nov 11, 2025
76 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2025
IvoneDjaja pushed a commit to IvoneDjaja/flutter that referenced this pull request Nov 22, 2025
…or a less broad API surface (flutter#177966)

* Add animationStyle to Exapnsible
* Mark duration, curve and reverseCurve as deprecated
* Add data driven fixes

fixes: flutter#177799

- [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] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
mboetger pushed a commit to mboetger/flutter that referenced this pull request Dec 2, 2025
…or a less broad API surface (flutter#177966)

## Changes

* Add animationStyle to Exapnsible
* Mark duration, curve and reverseCurve as deprecated
* Add data driven fixes

fixes: flutter#177799

## 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] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
…or a less broad API surface (flutter#177966)

## Changes

* Add animationStyle to Exapnsible
* Mark duration, curve and reverseCurve as deprecated
* Add data driven fixes

fixes: flutter#177799

## 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] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2026
@rkishan516 rkishan516 deleted the expansible-animation-style branch February 20, 2026 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: animation Animation APIs c: tech-debt Technical debt, code quality, testing, etc. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate Expansible animation properties to AnimationStyle for a less broad API surface

3 participants