Skip to content

Conversation

@nploi
Copy link
Contributor

@nploi nploi commented Aug 24, 2024

Currently we don't support custom transition duration for DialogRoute, CupertinoDialogRoute and show dialog methods , This PR will to support that.

Pre-launch Checklist

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

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Aug 24, 2024
Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

Hey @nploi thanks for the contribution! Can you add a test that verifies it works as expected? That will also ensure we do not undo this work in the future. Thanks!

@github-actions github-actions bot added f: cupertino flutter/packages/flutter/cupertino repository f: routes Navigator, Router, and related APIs. labels Aug 31, 2024
@nploi nploi changed the title Support custom transition duration for DialogRoute Support custom transition duration for DialogRoute, CupertinoDialogRoute and show dialogs. Aug 31, 2024
@nploi
Copy link
Contributor Author

nploi commented Aug 31, 2024

Hey @nploi thanks for the contribution! Can you add a test that verifies it works as expected? That will also ensure we do not undo this work in the future. Thanks!

Hi @Piinks, i added the tests for my changes. pls help to review. Thank you.

@nploi nploi requested a review from Piinks August 31, 2024 05:14
@nploi nploi changed the title Support custom transition duration for DialogRoute, CupertinoDialogRoute and show dialogs. Support custom transition duration for DialogRoute, CupertinoDialogRoute and show dialog methods. Aug 31, 2024
Copy link
Contributor

@nate-thegrate nate-thegrate left a comment

Choose a reason for hiding this comment

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

I left a couple of suggestions, but overall this is a fantastic improvement. Thanks!

@nploi nploi requested a review from nate-thegrate September 5, 2024 04:02
Copy link
Contributor

@nate-thegrate nate-thegrate left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for making this improvement!

Copy link
Member

@piedcipher piedcipher left a comment

Choose a reason for hiding this comment

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

some smol clean-up

@nploi
Copy link
Contributor Author

nploi commented Sep 5, 2024

some smol clean-up

thank for your review, i just fixed, pls help me check again 👍

@nploi nploi requested a review from piedcipher September 5, 2024 15:44
Copy link
Contributor

@dkwingsmt dkwingsmt left a comment

Choose a reason for hiding this comment

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

The changes look OK. The new argument needs documentation though.

bool barrierDismissible = false,
RouteSettings? routeSettings,
Offset? anchorPoint,
Duration? transitionDuration = _kCupertinoDialogRouteTransitionDuration,
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a paragraph to the doc to explain the transitionDuration and its default value, such as

///
/// The `transitionDuration` argument determines the duration of the transition animation. If it's
/// not provided or null, then it uses the default value as set by [CupertinoDialogRoute].

And also, either use the default value, or use a nullable value, but not default and nullable at the same time. I suggest using a nullable value so that the default duration is determined by CupertinoDialogRoute alone, meaning changing this line to

Suggested change
Duration? transitionDuration = _kCupertinoDialogRouteTransitionDuration,
Duration? transitionDuration,

and removing the ?? in L1330.

String? barrierLabel,
// This transition duration was eyeballed comparing with iOS
super.transitionDuration = const Duration(milliseconds: 250),
super.transitionDuration = _kCupertinoDialogRouteTransitionDuration,
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a paragraph to the doc of the constructor to explain the transitionDuration and its default value.

themes: themes,
anchorPoint: anchorPoint,
traversalEdgeBehavior: traversalEdgeBehavior ?? TraversalEdgeBehavior.closedLoop,
transitionDuration: transitionDuration ?? _kDialogRouteTransitionDuration,
Copy link
Contributor

Choose a reason for hiding this comment

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

As suggested above,

Suggested change
transitionDuration: transitionDuration ?? _kDialogRouteTransitionDuration,
transitionDuration: transitionDuration,

and add to doc.

RouteSettings? routeSettings,
Offset? anchorPoint,
TraversalEdgeBehavior? traversalEdgeBehavior,
Duration? transitionDuration,
Copy link
Contributor

Choose a reason for hiding this comment

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

As suggested above, add to doc.

super.requestFocus,
super.anchorPoint,
super.traversalEdgeBehavior,
super.transitionDuration = _kDialogRouteTransitionDuration,
Copy link
Contributor

Choose a reason for hiding this comment

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

Add to doc and explain default value.

Copy link
Member

@piedcipher piedcipher left a comment

Choose a reason for hiding this comment

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

LGTM

can we add set of tests for testing defaults too?

@nploi
Copy link
Contributor Author

nploi commented Sep 5, 2024

hi @dkwingsmt @piedcipher, Thank for your reviews. I just added docs, using nullable value and write a test for RawDialogRoute.transitionDuration, pls help to check it.

@nploi nploi requested a review from dkwingsmt September 5, 2024 19:04
@nate-thegrate
Copy link
Contributor

Looks like Linux Analyze is reporting a few trailing whitespace characters.

@nploi
Copy link
Contributor Author

nploi commented Sep 6, 2024

Looks like Linux Analyze is reporting a few trailing whitespace characters.

fixed.

@nate-thegrate
Copy link
Contributor

@nploi thanks for addressing all the feedback!

@nate-thegrate nate-thegrate added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 6, 2024
@auto-submit auto-submit bot merged commit 0eaeb0d into flutter:master Sep 6, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 6, 2024
@TahaTesser
Copy link
Member

@dkwingsmt @nate-thegrate
We introduced AnimationStyle class to override animation durations and curves.

Instead of introducing new durations and curves parameters, we used this class to override transitionDuration
For instance here

Duration get transitionDuration => popUpAnimationStyle?.duration ?? _kMenuDuration;

@TahaTesser
Copy link
Member

Just below this newly added transitionDuration, there are hard coded animation curves. If and when there is request to add support to customize these curves, we wouldn't want to add more new parameters.

image

Instead we could use AnimationStyle to override durations as well as curve, something like TextStyle for text

image

@TahaTesser
Copy link
Member

I would recommend reverting this PR in favor of AnimationStyle for complete animation duration and curve customization.

@nate-thegrate nate-thegrate added the revert Autorevert PR (with "Reason for revert:" comment) label Sep 6, 2024
@auto-submit

This comment was marked as resolved.

@auto-submit auto-submit bot removed the revert Autorevert PR (with "Reason for revert:" comment) label Sep 6, 2024
@nate-thegrate
Copy link
Contributor

Reason for revert: using AnimationStyle instead would allow for complete animation duration and curve customization.

@nate-thegrate nate-thegrate added the revert Autorevert PR (with "Reason for revert:" comment) label Sep 6, 2024
auto-submit bot pushed a commit that referenced this pull request Sep 6, 2024
…inoDialogRoute` and show dialog methods. (#154048)"

This reverts commit 0eaeb0d.
@auto-submit auto-submit bot removed the revert Autorevert PR (with "Reason for revert:" comment) label Sep 6, 2024
auto-submit bot added a commit that referenced this pull request Sep 6, 2024
…tinoDialogRoute` and show dialog methods. (#154048)" (#154743)

Reverts: #154048
Initiated by: nate-thegrate
Reason for reverting: using `AnimationStyle` instead would allow for complete animation duration and curve customization.

Original PR Author: nploi

Reviewed By: {piedcipher, nate-thegrate}

This change reverts the following previous change:
Currently we don't support custom transition duration for `DialogRoute`, `CupertinoDialogRoute` and show dialog methods , This PR will to support that.
@TahaTesser
Copy link
Member

TahaTesser commented Sep 6, 2024

Since AnimationStyle is relatively new, for every widget I included a sample. We should also add sample for this change too.
Please look at an existing animation style sample for default, custom, and no animation controls. You can copy this and replace the widget using new parameter.
https://api.flutter.dev/flutter/material/PopupMenuButton-class.html#material.PopupMenuButton.4

Add the widget supporting AnimationStyle in the docs

cc: @nate-thegrate

@nate-thegrate
Copy link
Contributor

@TahaTesser thanks very much for this information!

I've created an issue to track progress on this feature: #154744

cc: @nploi

@dkwingsmt
Copy link
Contributor

Thank you very much for this information! Learning something today!

auto-submit bot pushed a commit to flutter/packages that referenced this pull request Sep 6, 2024
flutter/flutter@45ef8f3...2e221e7

2024-09-06 leroux_bruno@yahoo.fr Fix DropdownMenu focused item styles (flutter/flutter#153159)
2024-09-06 phucloi.nguyen@manabie.com Support custom transition duration for `DialogRoute`, `CupertinoDialogRoute` and show dialog methods. (flutter/flutter#154048)
2024-09-06 51940183+Sameri11@users.noreply.github.com [tool] Add `dartFileName` setting for platform plugins  (flutter/flutter#153099)
2024-09-06 reidbaker@google.com [Conductor] Add ability to override mirror, add tests for default arg parsing and custom arg parsing (flutter/flutter#154363)
2024-09-06 59215665+davidhicks980@users.noreply.github.com Improve CupertinoPopupSurface appearance (flutter/flutter#151430)
2024-09-06 engine-flutter-autoroll@skia.org Roll Packages from 71e827e to 56df73e (1 revision) (flutter/flutter#154725)
2024-09-06 goderbauer@google.com Quick access to style guide (flutter/flutter#154689)
2024-09-06 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Flutter Engine from c50eb8a65097 to 015f3b1dec53 (2 revisions) (#154691)" (flutter/flutter#154726)
2024-09-05 737941+loic-sharma@users.noreply.github.com Improve iOS unpack target's error messages (flutter/flutter#154649)
2024-09-05 30870216+gaaclarke@users.noreply.github.com Made some pixel tests fuzzy (flutter/flutter#154680)
2024-09-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from c50eb8a65097 to 015f3b1dec53 (2 revisions) (flutter/flutter#154691)
2024-09-05 49699333+dependabot[bot]@users.noreply.github.com Bump peter-evans/create-pull-request from 7.0.0 to 7.0.1 (flutter/flutter#154690)
2024-09-05 36861262+QuncCccccc@users.noreply.github.com Normalize Dialog theme (flutter/flutter#153982)
2024-09-05 chris@bracken.jp iOS,macOS: Do not copy unsigned_binaries.txt to build outputs (flutter/flutter#154684)
2024-09-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from e042ff5df7af to c50eb8a65097 (1 revision) (flutter/flutter#154679)
2024-09-05 34871572+gmackall@users.noreply.github.com Add proguard rule to keep the class for all implementations of FlutterPlugin (flutter/flutter#154677)
2024-09-05 bruno.leroux@gmail.com Fix DropdownMenu menu does not follow the text field (flutter/flutter#154667)
2024-09-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from a156e713f4dc to e042ff5df7af (1 revision) (flutter/flutter#154678)
2024-09-05 103767860+dy0gu@users.noreply.github.com Fix ZoomPageTransitionsBuilder hardcoded fill color (flutter/flutter#154057)
2024-09-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from 34b61eb53b99 to a156e713f4dc (1 revision) (flutter/flutter#154672)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC bmparr@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
@nate-thegrate nate-thegrate added the was reverted (optionally) marks a pull request as having been reverted after it was merged label Sep 6, 2024
@nploi
Copy link
Contributor Author

nploi commented Sep 7, 2024

@TahaTesser thanks very much for this information!

I've created an issue to track progress on this feature: #154744

cc: @nploi

Thank you @nate-thegrate @TahaTesser, i will support AnimationStyle for show dialog methods.

can you assign me this #154744 @nate-thegrate ?

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 11, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App f: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository. f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels. was reverted (optionally) marks a pull request as having been reverted after it was merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants