-
Notifications
You must be signed in to change notification settings - Fork 29.7k
fix: ensure draggable_scrollable_sheet respects shouldCloseOnMinExten… #156338
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. |
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.
Looks great!
Only thing we're missing is a test—gotta make sure we don't accidentally break or revert this in the future.
| Duration? snapAnimationDuration, | ||
| bool shouldCloseOnMinExtent = true, | ||
| required Duration? snapAnimationDuration, | ||
| required bool shouldCloseOnMinExtent, |
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 guess whether these are required doesn't matter too much since it's a private class… I like how it looks though 👍
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.
private class should have required since we own all the call site
chunhtai
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.
change looks good to me, but we need a test
|
(PR triage): @kirya355 thanks for contributing. Do you plan to continue working on this change? |
Yes, I do plan to continue working on this change. Thank you for your attention! |
|
I have added a test to verify that DraggableScrollableSheet respects the shouldCloseOnMinExtent property. Please take a look when you have a chance. |
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.
Thanks @kirya355!
Would you be able to do a rebase so we can get those checks running?
packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart
Outdated
Show resolved
Hide resolved
…dart Co-authored-by: Nate Wilson <[email protected]>
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.
Thanks for following up on this! Just have a couple of small suggestions :)
…dart Co-authored-by: Nate Wilson <[email protected]>
…dart Co-authored-by: Nate Wilson <[email protected]>
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.
chunhtai
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
| Duration? snapAnimationDuration, | ||
| bool shouldCloseOnMinExtent = true, | ||
| required Duration? snapAnimationDuration, | ||
| required bool shouldCloseOnMinExtent, |
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.
private class should have required since we own all the call site
flutter/flutter@29d40f7...73546b3 2024-11-06 [email protected] Add test for `image.loading_builder.0.dart` (flutter/flutter#158248) 2024-11-06 [email protected] Make flutter_tools use newest package:{native_assets_builder,native_assets_cli,native_toolchain_c} (flutter/flutter#158214) 2024-11-06 [email protected] Fix RawScrollbar examples and desktop test (flutter/flutter#158237) 2024-11-06 [email protected] Cleanup MenuAnchor and Improve DropdownMenu tests readability (flutter/flutter#158175) 2024-11-06 [email protected] Roll Flutter Engine from a3741d6248b7 to f03f11300a9d (2 revisions) (flutter/flutter#158222) 2024-11-06 [email protected] Update error message for Cocoapods support for synchronized groups/folders (flutter/flutter#158206) 2024-11-06 [email protected] Restore skipped iOS test by looping over `FakeAsync` elapse. (flutter/flutter#158204) 2024-11-06 [email protected] fix: ensure draggable_scrollable_sheet respects shouldCloseOnMinExten� (flutter/flutter#156338) 2024-11-06 [email protected] Roll Flutter Engine from e5e06c97c33c to a3741d6248b7 (14 revisions) (flutter/flutter#158218) 2024-11-06 [email protected] Forward fix `CupertinoDynamicColor` by adding `toARGB32()`. (flutter/flutter#158145) 2024-11-05 [email protected] Remove unused `enableObservatory` flag. (flutter/flutter#158202) 2024-11-05 [email protected] Remove observatory related TODO that is already fixed. (flutter/flutter#158205) 2024-11-05 [email protected] Factor out "shaker" class (flutter/flutter#157748) 2024-11-05 [email protected] Marks Mac_benchmark animated_complex_opacity_perf_macos__e2e_summary to be flaky (flutter/flutter#157424) 2024-11-05 [email protected] Increase subsharding for `Linux tool_integration_tests` (flutter/flutter#158196) 2024-11-05 [email protected] Add test for `raw_scrollbar.2.dart` (flutter/flutter#158161) 2024-11-05 [email protected] use root directory as the default for rootOverride in Cache.test constructor (flutter/flutter#158201) 2024-11-05 [email protected] Kill interactive script job `xcdevice observe` processes on tool/daemon shutdown (flutter/flutter#157646) 2024-11-05 [email protected] Fix: Gap between prefix and suffix icon and input field in input deco� (flutter/flutter#152069) 2024-11-05 [email protected] Roll Flutter Engine from f56401062e42 to e5e06c97c33c (1 revision) (flutter/flutter#158194) 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 [email protected],[email protected] 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

This PR fixes the
shouldCloseOnMinExtentflag indraggable_scrollable_sheet.dart.The
shouldCloseOnMinExtentflag was not functioning correctly in theDraggableScrollableSheetwidget. This PR ensures that the flag is properly handled, preventing the sheet from closing when it reaches the minimum extent if the flag is set to false. Before/after screenshots are not applicable for this change.In the code sample below, before my fix, the sheet would close when scrolled down. After my fix, it behaves as expected by respecting the
shouldCloseOnMinExtentparameter.Code Sample
Pre-launch Checklist
///).