-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Support custom transition duration for DialogRoute, CupertinoDialogRoute and show dialog methods.
#154048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
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. |
Piinks
left a comment
There was a problem hiding this 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!
DialogRouteDialogRoute, CupertinoDialogRoute and show dialogs.
DialogRoute, CupertinoDialogRoute and show dialogs.DialogRoute, CupertinoDialogRoute and show dialog methods.
nate-thegrate
left a comment
There was a problem hiding this 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!
nate-thegrate
left a comment
There was a problem hiding this 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!
piedcipher
left a comment
There was a problem hiding this 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
thank for your review, i just fixed, pls help me check again 👍 |
dkwingsmt
left a comment
There was a problem hiding this 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, |
There was a problem hiding this comment.
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
| 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, |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As suggested above,
| transitionDuration: transitionDuration ?? _kDialogRouteTransitionDuration, | |
| transitionDuration: transitionDuration, |
and add to doc.
| RouteSettings? routeSettings, | ||
| Offset? anchorPoint, | ||
| TraversalEdgeBehavior? traversalEdgeBehavior, | ||
| Duration? transitionDuration, |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
piedcipher
left a comment
There was a problem hiding this 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?
|
hi @dkwingsmt @piedcipher, Thank for your reviews. I just added docs, using nullable value and write a test for |
|
Looks like Linux Analyze is reporting a few trailing whitespace characters. |
fixed. |
|
@nploi thanks for addressing all the feedback! |
…inoDialogRoute` and show dialog methods. (flutter/flutter#154048)
|
@dkwingsmt @nate-thegrate Instead of introducing new durations and curves parameters, we used this class to override
|
|
I would recommend reverting this PR in favor of |
This comment was marked as resolved.
This comment was marked as resolved.
|
Reason for revert: using |
…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.
|
Since Add the widget supporting cc: @nate-thegrate |
|
@TahaTesser thanks very much for this information! I've created an issue to track progress on this feature: #154744 cc: @nploi |
|
Thank you very much for this information! Learning something today! |
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
Thank you @nate-thegrate @TahaTesser, i will support can you assign me this #154744 @nate-thegrate ? |
…inoDialogRoute` and show dialog methods. (flutter/flutter#154048)
…inoDialogRoute` and show dialog methods. (flutter/flutter#154048)


Currently we don't support custom transition duration for
DialogRoute,CupertinoDialogRouteand 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.