Fix: DraggableScrollableSheet may not close if snapping is enabled#165557
Fix: DraggableScrollableSheet may not close if snapping is enabled#165557auto-submit[bot] merged 7 commits intoflutter:masterfrom
Conversation
a6f07f5 to
c135caa
Compare
c135caa to
67abd35
Compare
|
This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
justinmc
left a comment
There was a problem hiding this comment.
LGTM with nits 👍
Thanks for jumping in and fixing this!
| /// Checks if the sheet's current size is close to a snap size, returning the | ||
| /// snap size if so; returns null otherwise. |
There was a problem hiding this comment.
Nit: I would make this 2 slashes instead of 3. Using 3 is for dart-doc-like comments.
| return extent.snapSizes.any((double snapSize) { | ||
| /// Checks if the sheet's current size is close to a snap size, returning the | ||
| /// snap size if so; returns null otherwise. | ||
| double? get _currentSnapSize { |
There was a problem hiding this comment.
Nit: I wouldn't make this a getter, to emphasize that there's some calculation that needs to be done.
double? _getCurrentSnapSize() {There was a problem hiding this comment.
There was a problem hiding this comment.
@justinmc Thanks for reviewing.
Would it be better to rewrite getters using _currentSnapSize such as _isAtSnapSize and _shouldSnap as a method as well?
flutter/packages/flutter/lib/src/widgets/draggable_scrollable_sheet.dart
Lines 922 to 924 in bc18a80
There was a problem hiding this comment.
Ah yes you're right, thanks for catching that.
| controller.dispose(); | ||
| }); | ||
|
|
||
| testWidgets('Ensures DraggableScrollableSheet snaps exactly to minChildSize', ( |
There was a problem hiding this comment.
Can you add a link to the issue in a comment? Regression test for https://github.com/flutter/flutter/issues/140701.
| const Duration(milliseconds: 500), | ||
| ); | ||
| expect(lastExtent, .25); | ||
| }); |
There was a problem hiding this comment.
I confirmed that this fails on master with a tiny rounding error as expected 👍
justinmc
left a comment
There was a problem hiding this comment.
Renewing my LGTM and will add the autosubmit label.
Manual roll Flutter from 212064a to 9bf18f0 (32 revisions) Manual roll requested by [email protected] flutter/flutter@212064a...9bf18f0 2025-04-08 [email protected] bump warn agp version from 7.3 to 8.3 (flutter/flutter#166555) 2025-04-08 [email protected] Roll Skia from 57a1644f0f8f to 7b929584566c (1 revision) (flutter/flutter#166760) 2025-04-08 [email protected] Enable a swath of `bringup: true` builds that were forgotten to the void. (flutter/flutter#166757) 2025-04-08 [email protected] add check for announcement support per platform (flutter/flutter#166099) 2025-04-08 [email protected] Roll Skia from 515eb6238867 to 57a1644f0f8f (1 revision) (flutter/flutter#166748) 2025-04-08 [email protected] Roll Skia from 3ea44c88d37b to 515eb6238867 (1 revision) (flutter/flutter#166742) 2025-04-08 [email protected] Roll Skia from 7d56b9cc7ce9 to 3ea44c88d37b (1 revision) (flutter/flutter#166741) 2025-04-08 [email protected] Roll Skia from 245d2b8fb042 to 7d56b9cc7ce9 (2 revisions) (flutter/flutter#166737) 2025-04-08 [email protected] Fix `DropdownMenu` keyboard navigation on filtered entries (flutter/flutter#165868) 2025-04-08 [email protected] Fix: DraggableScrollableSheet may not close if snapping is enabled (flutter/flutter#165557) 2025-04-08 [email protected] Roll pub packages (flutter/flutter#166503) 2025-04-08 [email protected] Add `RoundedSuperellipseBorder` and apply it to `CupertinoActionSheet` (flutter/flutter#166303) 2025-04-07 [email protected] Roll Skia from f493d403c01b to 245d2b8fb042 (3 revisions) (flutter/flutter#166720) 2025-04-07 [email protected] [web] reland fix text selection offset in multi-line fields (flutter/flutter#166714) 2025-04-07 [email protected] [flutter_tools] Update dwds version to 24.3.10 (flutter/flutter#166699) 2025-04-07 [email protected] Roll Skia from 5f0f9b76b975 to f493d403c01b (3 revisions) (flutter/flutter#166710) 2025-04-07 [email protected] Roll HarfBuzz to 11.0.0 (flutter/flutter#166596) 2025-04-07 [email protected] Fix: CupertinoSheetTransition moves SystemUIOverlayStyle to outside of delegatedTransition and only changes top bar (flutter/flutter#164680) 2025-04-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Reverts "Remove `bringup:true` from Linux tool_tests_widget_preview_scaffold (#166687)" (#166700)" (flutter/flutter#166711) 2025-04-07 [email protected] [ Widget Preview ] Update generated test files (flutter/flutter#166701) 2025-04-07 [email protected] Roll Skia from 339ef4f48c29 to 5f0f9b76b975 (1 revision) (flutter/flutter#166690) 2025-04-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Remove `bringup:true` from Linux tool_tests_widget_preview_scaffold (#166687)" (flutter/flutter#166700) 2025-04-07 [email protected] [reland] Convert the Flutter Gradle Plugin entirely to Kotlin source (flutter/flutter#166676) 2025-04-07 [email protected] Remove `bringup:true` from Linux tool_tests_widget_preview_scaffold (flutter/flutter#166687) 2025-04-07 [email protected] [Widget Preview] implemented gridview and listview layouts (flutter/flutter#166150) 2025-04-07 [email protected] Roll Skia from 966d9c665eed to 339ef4f48c29 (1 revision) (flutter/flutter#166680) 2025-04-07 [email protected] Roll Skia from 8505be5b584e to 966d9c665eed (2 revisions) (flutter/flutter#166675) 2025-04-07 [email protected] Feat: Add yearShape property to DatePickerThemeData (flutter/flutter#163909) 2025-04-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Convert the Flutter Gradle Plugin entirely to Kotlin source (#166114)" (flutter/flutter#166666) 2025-04-07 [email protected] Convert the Flutter Gradle Plugin entirely to Kotlin source (flutter/flutter#166114) 2025-04-06 [email protected] Make coverage collection aware of workspaces (flutter/flutter#166389) 2025-04-06 [email protected] Roll Skia from da7929d79c28 to 8505be5b584e (1 revision) (flutter/flutter#166661) 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] 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 ...
) Manual roll Flutter from 212064a to 9bf18f0 (32 revisions) Manual roll requested by [email protected] flutter/flutter@212064a...9bf18f0 2025-04-08 [email protected] bump warn agp version from 7.3 to 8.3 (flutter/flutter#166555) 2025-04-08 [email protected] Roll Skia from 57a1644f0f8f to 7b929584566c (1 revision) (flutter/flutter#166760) 2025-04-08 [email protected] Enable a swath of `bringup: true` builds that were forgotten to the void. (flutter/flutter#166757) 2025-04-08 [email protected] add check for announcement support per platform (flutter/flutter#166099) 2025-04-08 [email protected] Roll Skia from 515eb6238867 to 57a1644f0f8f (1 revision) (flutter/flutter#166748) 2025-04-08 [email protected] Roll Skia from 3ea44c88d37b to 515eb6238867 (1 revision) (flutter/flutter#166742) 2025-04-08 [email protected] Roll Skia from 7d56b9cc7ce9 to 3ea44c88d37b (1 revision) (flutter/flutter#166741) 2025-04-08 [email protected] Roll Skia from 245d2b8fb042 to 7d56b9cc7ce9 (2 revisions) (flutter/flutter#166737) 2025-04-08 [email protected] Fix `DropdownMenu` keyboard navigation on filtered entries (flutter/flutter#165868) 2025-04-08 [email protected] Fix: DraggableScrollableSheet may not close if snapping is enabled (flutter/flutter#165557) 2025-04-08 [email protected] Roll pub packages (flutter/flutter#166503) 2025-04-08 [email protected] Add `RoundedSuperellipseBorder` and apply it to `CupertinoActionSheet` (flutter/flutter#166303) 2025-04-07 [email protected] Roll Skia from f493d403c01b to 245d2b8fb042 (3 revisions) (flutter/flutter#166720) 2025-04-07 [email protected] [web] reland fix text selection offset in multi-line fields (flutter/flutter#166714) 2025-04-07 [email protected] [flutter_tools] Update dwds version to 24.3.10 (flutter/flutter#166699) 2025-04-07 [email protected] Roll Skia from 5f0f9b76b975 to f493d403c01b (3 revisions) (flutter/flutter#166710) 2025-04-07 [email protected] Roll HarfBuzz to 11.0.0 (flutter/flutter#166596) 2025-04-07 [email protected] Fix: CupertinoSheetTransition moves SystemUIOverlayStyle to outside of delegatedTransition and only changes top bar (flutter/flutter#164680) 2025-04-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Reverts "Remove `bringup:true` from Linux tool_tests_widget_preview_scaffold (#166687)" (#166700)" (flutter/flutter#166711) 2025-04-07 [email protected] [ Widget Preview ] Update generated test files (flutter/flutter#166701) 2025-04-07 [email protected] Roll Skia from 339ef4f48c29 to 5f0f9b76b975 (1 revision) (flutter/flutter#166690) 2025-04-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Remove `bringup:true` from Linux tool_tests_widget_preview_scaffold (#166687)" (flutter/flutter#166700) 2025-04-07 [email protected] [reland] Convert the Flutter Gradle Plugin entirely to Kotlin source (flutter/flutter#166676) 2025-04-07 [email protected] Remove `bringup:true` from Linux tool_tests_widget_preview_scaffold (flutter/flutter#166687) 2025-04-07 [email protected] [Widget Preview] implemented gridview and listview layouts (flutter/flutter#166150) 2025-04-07 [email protected] Roll Skia from 966d9c665eed to 339ef4f48c29 (1 revision) (flutter/flutter#166680) 2025-04-07 [email protected] Roll Skia from 8505be5b584e to 966d9c665eed (2 revisions) (flutter/flutter#166675) 2025-04-07 [email protected] Feat: Add yearShape property to DatePickerThemeData (flutter/flutter#163909) 2025-04-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Convert the Flutter Gradle Plugin entirely to Kotlin source (#166114)" (flutter/flutter#166666) 2025-04-07 [email protected] Convert the Flutter Gradle Plugin entirely to Kotlin source (flutter/flutter#166114) 2025-04-06 [email protected] Make coverage collection aware of workspaces (flutter/flutter#166389) 2025-04-06 [email protected] Roll Skia from da7929d79c28 to 8505be5b584e (1 revision) (flutter/flutter#166661) 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] 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 ...
…(#9041) Manual roll Flutter from 212064a3e558 to 9bf18f097137 (32 revisions) Manual roll requested by [email protected] flutter/flutter@212064a...9bf18f0 2025-04-08 [email protected] bump warn agp version from 7.3 to 8.3 (flutter/flutter#166555) 2025-04-08 [email protected] Roll Skia from 57a1644f0f8f to 7b929584566c (1 revision) (flutter/flutter#166760) 2025-04-08 [email protected] Enable a swath of `bringup: true` builds that were forgotten to the void. (flutter/flutter#166757) 2025-04-08 [email protected] add check for announcement support per platform (flutter/flutter#166099) 2025-04-08 [email protected] Roll Skia from 515eb6238867 to 57a1644f0f8f (1 revision) (flutter/flutter#166748) 2025-04-08 [email protected] Roll Skia from 3ea44c88d37b to 515eb6238867 (1 revision) (flutter/flutter#166742) 2025-04-08 [email protected] Roll Skia from 7d56b9cc7ce9 to 3ea44c88d37b (1 revision) (flutter/flutter#166741) 2025-04-08 [email protected] Roll Skia from 245d2b8fb042 to 7d56b9cc7ce9 (2 revisions) (flutter/flutter#166737) 2025-04-08 [email protected] Fix `DropdownMenu` keyboard navigation on filtered entries (flutter/flutter#165868) 2025-04-08 [email protected] Fix: DraggableScrollableSheet may not close if snapping is enabled (flutter/flutter#165557) 2025-04-08 [email protected] Roll pub packages (flutter/flutter#166503) 2025-04-08 [email protected] Add `RoundedSuperellipseBorder` and apply it to `CupertinoActionSheet` (flutter/flutter#166303) 2025-04-07 [email protected] Roll Skia from f493d403c01b to 245d2b8fb042 (3 revisions) (flutter/flutter#166720) 2025-04-07 [email protected] [web] reland fix text selection offset in multi-line fields (flutter/flutter#166714) 2025-04-07 [email protected] [flutter_tools] Update dwds version to 24.3.10 (flutter/flutter#166699) 2025-04-07 [email protected] Roll Skia from 5f0f9b76b975 to f493d403c01b (3 revisions) (flutter/flutter#166710) 2025-04-07 [email protected] Roll HarfBuzz to 11.0.0 (flutter/flutter#166596) 2025-04-07 [email protected] Fix: CupertinoSheetTransition moves SystemUIOverlayStyle to outside of delegatedTransition and only changes top bar (flutter/flutter#164680) 2025-04-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Reverts "Remove `bringup:true` from Linux tool_tests_widget_preview_scaffold (#166687)" (#166700)" (flutter/flutter#166711) 2025-04-07 [email protected] [ Widget Preview ] Update generated test files (flutter/flutter#166701) 2025-04-07 [email protected] Roll Skia from 339ef4f48c29 to 5f0f9b76b975 (1 revision) (flutter/flutter#166690) 2025-04-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Remove `bringup:true` from Linux tool_tests_widget_preview_scaffold (#166687)" (flutter/flutter#166700) 2025-04-07 [email protected] [reland] Convert the Flutter Gradle Plugin entirely to Kotlin source (flutter/flutter#166676) 2025-04-07 [email protected] Remove `bringup:true` from Linux tool_tests_widget_preview_scaffold (flutter/flutter#166687) 2025-04-07 [email protected] [Widget Preview] implemented gridview and listview layouts (flutter/flutter#166150) 2025-04-07 [email protected] Roll Skia from 966d9c665eed to 339ef4f48c29 (1 revision) (flutter/flutter#166680) 2025-04-07 [email protected] Roll Skia from 8505be5b584e to 966d9c665eed (2 revisions) (flutter/flutter#166675) 2025-04-07 [email protected] Feat: Add yearShape property to DatePickerThemeData (flutter/flutter#163909) 2025-04-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Convert the Flutter Gradle Plugin entirely to Kotlin source (#166114)" (flutter/flutter#166666) 2025-04-07 [email protected] Convert the Flutter Gradle Plugin entirely to Kotlin source (flutter/flutter#166114) 2025-04-06 [email protected] Make coverage collection aware of workspaces (flutter/flutter#166389) 2025-04-06 [email protected] Roll Skia from da7929d79c28 to 8505be5b584e (1 revision) (flutter/flutter#166661) 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] 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 ...
) Manual roll Flutter from 212064a to 9bf18f0 (32 revisions) Manual roll requested by [email protected] flutter/flutter@212064a...9bf18f0 2025-04-08 [email protected] bump warn agp version from 7.3 to 8.3 (flutter/flutter#166555) 2025-04-08 [email protected] Roll Skia from 57a1644f0f8f to 7b929584566c (1 revision) (flutter/flutter#166760) 2025-04-08 [email protected] Enable a swath of `bringup: true` builds that were forgotten to the void. (flutter/flutter#166757) 2025-04-08 [email protected] add check for announcement support per platform (flutter/flutter#166099) 2025-04-08 [email protected] Roll Skia from 515eb6238867 to 57a1644f0f8f (1 revision) (flutter/flutter#166748) 2025-04-08 [email protected] Roll Skia from 3ea44c88d37b to 515eb6238867 (1 revision) (flutter/flutter#166742) 2025-04-08 [email protected] Roll Skia from 7d56b9cc7ce9 to 3ea44c88d37b (1 revision) (flutter/flutter#166741) 2025-04-08 [email protected] Roll Skia from 245d2b8fb042 to 7d56b9cc7ce9 (2 revisions) (flutter/flutter#166737) 2025-04-08 [email protected] Fix `DropdownMenu` keyboard navigation on filtered entries (flutter/flutter#165868) 2025-04-08 [email protected] Fix: DraggableScrollableSheet may not close if snapping is enabled (flutter/flutter#165557) 2025-04-08 [email protected] Roll pub packages (flutter/flutter#166503) 2025-04-08 [email protected] Add `RoundedSuperellipseBorder` and apply it to `CupertinoActionSheet` (flutter/flutter#166303) 2025-04-07 [email protected] Roll Skia from f493d403c01b to 245d2b8fb042 (3 revisions) (flutter/flutter#166720) 2025-04-07 [email protected] [web] reland fix text selection offset in multi-line fields (flutter/flutter#166714) 2025-04-07 [email protected] [flutter_tools] Update dwds version to 24.3.10 (flutter/flutter#166699) 2025-04-07 [email protected] Roll Skia from 5f0f9b76b975 to f493d403c01b (3 revisions) (flutter/flutter#166710) 2025-04-07 [email protected] Roll HarfBuzz to 11.0.0 (flutter/flutter#166596) 2025-04-07 [email protected] Fix: CupertinoSheetTransition moves SystemUIOverlayStyle to outside of delegatedTransition and only changes top bar (flutter/flutter#164680) 2025-04-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Reverts "Remove `bringup:true` from Linux tool_tests_widget_preview_scaffold (#166687)" (#166700)" (flutter/flutter#166711) 2025-04-07 [email protected] [ Widget Preview ] Update generated test files (flutter/flutter#166701) 2025-04-07 [email protected] Roll Skia from 339ef4f48c29 to 5f0f9b76b975 (1 revision) (flutter/flutter#166690) 2025-04-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Remove `bringup:true` from Linux tool_tests_widget_preview_scaffold (#166687)" (flutter/flutter#166700) 2025-04-07 [email protected] [reland] Convert the Flutter Gradle Plugin entirely to Kotlin source (flutter/flutter#166676) 2025-04-07 [email protected] Remove `bringup:true` from Linux tool_tests_widget_preview_scaffold (flutter/flutter#166687) 2025-04-07 [email protected] [Widget Preview] implemented gridview and listview layouts (flutter/flutter#166150) 2025-04-07 [email protected] Roll Skia from 966d9c665eed to 339ef4f48c29 (1 revision) (flutter/flutter#166680) 2025-04-07 [email protected] Roll Skia from 8505be5b584e to 966d9c665eed (2 revisions) (flutter/flutter#166675) 2025-04-07 [email protected] Feat: Add yearShape property to DatePickerThemeData (flutter/flutter#163909) 2025-04-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Convert the Flutter Gradle Plugin entirely to Kotlin source (#166114)" (flutter/flutter#166666) 2025-04-07 [email protected] Convert the Flutter Gradle Plugin entirely to Kotlin source (flutter/flutter#166114) 2025-04-06 [email protected] Make coverage collection aware of workspaces (flutter/flutter#166389) 2025-04-06 [email protected] Roll Skia from da7929d79c28 to 8505be5b584e (1 revision) (flutter/flutter#166661) 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] 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 ...
…lutter#165557) <!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> fixes flutter#140701 This PR fixes an issue where a DraggableScrollableSheet with `snap` set to true and `shouldCloseOnMinExtent` set to true may not close when dragged downward. The issue was caused by round-off errors accumulated by `addPixelDelta` method, which could lead to `extent.currentSize` not matching the `extent.minSize` exactly when the bottom is reached. I added logic to correct it when the snapping ballistic animation is complete. <details> <summary>Sample code</summary> ```Dart import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @OverRide Widget build(BuildContext context) { return MaterialApp( home: HomePage(), ); } } class HomePage extends StatelessWidget { const HomePage({super.key}); @OverRide Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("DraggableScrollableSheet Test"), ), body: Center( child: ElevatedButton( child: Text("Open"), onPressed: () { showModalBottomSheet( context: context, showDragHandle: true, isScrollControlled: true, builder: (context) => _buildBottomSheet(), ); }, ), ), ); } Widget _buildBottomSheet() { return NotificationListener<DraggableScrollableNotification>( onNotification: (notification) { print(notification.extent); return false; }, child: DraggableScrollableSheet( expand: false, snap: true, shouldCloseOnMinExtent: true, maxChildSize: 0.9, minChildSize: 0.25, builder: (context, scrollController) { return ListView.builder( controller: scrollController, itemCount: 100, itemBuilder: (context, index) { return ListTile( title: Text("Item $index"), ); }, ); }, ), ); } } ``` </details> | Before applying fix | After | | --- | --- | | * Occurs with probability <video src="proxy.php?url=https://github.com/user-attachments/assets/ffd2d097-3ed5-4775-90d5-950092d49591"> | <video src="proxy.php?url=https://github.com/user-attachments/assets/0f20cb81-3444-40a3-a84d-ed4bff15887e"> | ## 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. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#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/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
) Manual roll Flutter from 212064a to 9bf18f0 (32 revisions) Manual roll requested by [email protected] flutter/flutter@212064a...9bf18f0 2025-04-08 [email protected] bump warn agp version from 7.3 to 8.3 (flutter/flutter#166555) 2025-04-08 [email protected] Roll Skia from 57a1644f0f8f to 7b929584566c (1 revision) (flutter/flutter#166760) 2025-04-08 [email protected] Enable a swath of `bringup: true` builds that were forgotten to the void. (flutter/flutter#166757) 2025-04-08 [email protected] add check for announcement support per platform (flutter/flutter#166099) 2025-04-08 [email protected] Roll Skia from 515eb6238867 to 57a1644f0f8f (1 revision) (flutter/flutter#166748) 2025-04-08 [email protected] Roll Skia from 3ea44c88d37b to 515eb6238867 (1 revision) (flutter/flutter#166742) 2025-04-08 [email protected] Roll Skia from 7d56b9cc7ce9 to 3ea44c88d37b (1 revision) (flutter/flutter#166741) 2025-04-08 [email protected] Roll Skia from 245d2b8fb042 to 7d56b9cc7ce9 (2 revisions) (flutter/flutter#166737) 2025-04-08 [email protected] Fix `DropdownMenu` keyboard navigation on filtered entries (flutter/flutter#165868) 2025-04-08 [email protected] Fix: DraggableScrollableSheet may not close if snapping is enabled (flutter/flutter#165557) 2025-04-08 [email protected] Roll pub packages (flutter/flutter#166503) 2025-04-08 [email protected] Add `RoundedSuperellipseBorder` and apply it to `CupertinoActionSheet` (flutter/flutter#166303) 2025-04-07 [email protected] Roll Skia from f493d403c01b to 245d2b8fb042 (3 revisions) (flutter/flutter#166720) 2025-04-07 [email protected] [web] reland fix text selection offset in multi-line fields (flutter/flutter#166714) 2025-04-07 [email protected] [flutter_tools] Update dwds version to 24.3.10 (flutter/flutter#166699) 2025-04-07 [email protected] Roll Skia from 5f0f9b76b975 to f493d403c01b (3 revisions) (flutter/flutter#166710) 2025-04-07 [email protected] Roll HarfBuzz to 11.0.0 (flutter/flutter#166596) 2025-04-07 [email protected] Fix: CupertinoSheetTransition moves SystemUIOverlayStyle to outside of delegatedTransition and only changes top bar (flutter/flutter#164680) 2025-04-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Reverts "Remove `bringup:true` from Linux tool_tests_widget_preview_scaffold (#166687)" (#166700)" (flutter/flutter#166711) 2025-04-07 [email protected] [ Widget Preview ] Update generated test files (flutter/flutter#166701) 2025-04-07 [email protected] Roll Skia from 339ef4f48c29 to 5f0f9b76b975 (1 revision) (flutter/flutter#166690) 2025-04-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Remove `bringup:true` from Linux tool_tests_widget_preview_scaffold (#166687)" (flutter/flutter#166700) 2025-04-07 [email protected] [reland] Convert the Flutter Gradle Plugin entirely to Kotlin source (flutter/flutter#166676) 2025-04-07 [email protected] Remove `bringup:true` from Linux tool_tests_widget_preview_scaffold (flutter/flutter#166687) 2025-04-07 [email protected] [Widget Preview] implemented gridview and listview layouts (flutter/flutter#166150) 2025-04-07 [email protected] Roll Skia from 966d9c665eed to 339ef4f48c29 (1 revision) (flutter/flutter#166680) 2025-04-07 [email protected] Roll Skia from 8505be5b584e to 966d9c665eed (2 revisions) (flutter/flutter#166675) 2025-04-07 [email protected] Feat: Add yearShape property to DatePickerThemeData (flutter/flutter#163909) 2025-04-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Convert the Flutter Gradle Plugin entirely to Kotlin source (#166114)" (flutter/flutter#166666) 2025-04-07 [email protected] Convert the Flutter Gradle Plugin entirely to Kotlin source (flutter/flutter#166114) 2025-04-06 [email protected] Make coverage collection aware of workspaces (flutter/flutter#166389) 2025-04-06 [email protected] Roll Skia from da7929d79c28 to 8505be5b584e (1 revision) (flutter/flutter#166661) 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] 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 ...
) Manual roll Flutter from 212064a to 9bf18f0 (32 revisions) Manual roll requested by [email protected] flutter/flutter@212064a...9bf18f0 2025-04-08 [email protected] bump warn agp version from 7.3 to 8.3 (flutter/flutter#166555) 2025-04-08 [email protected] Roll Skia from 57a1644f0f8f to 7b929584566c (1 revision) (flutter/flutter#166760) 2025-04-08 [email protected] Enable a swath of `bringup: true` builds that were forgotten to the void. (flutter/flutter#166757) 2025-04-08 [email protected] add check for announcement support per platform (flutter/flutter#166099) 2025-04-08 [email protected] Roll Skia from 515eb6238867 to 57a1644f0f8f (1 revision) (flutter/flutter#166748) 2025-04-08 [email protected] Roll Skia from 3ea44c88d37b to 515eb6238867 (1 revision) (flutter/flutter#166742) 2025-04-08 [email protected] Roll Skia from 7d56b9cc7ce9 to 3ea44c88d37b (1 revision) (flutter/flutter#166741) 2025-04-08 [email protected] Roll Skia from 245d2b8fb042 to 7d56b9cc7ce9 (2 revisions) (flutter/flutter#166737) 2025-04-08 [email protected] Fix `DropdownMenu` keyboard navigation on filtered entries (flutter/flutter#165868) 2025-04-08 [email protected] Fix: DraggableScrollableSheet may not close if snapping is enabled (flutter/flutter#165557) 2025-04-08 [email protected] Roll pub packages (flutter/flutter#166503) 2025-04-08 [email protected] Add `RoundedSuperellipseBorder` and apply it to `CupertinoActionSheet` (flutter/flutter#166303) 2025-04-07 [email protected] Roll Skia from f493d403c01b to 245d2b8fb042 (3 revisions) (flutter/flutter#166720) 2025-04-07 [email protected] [web] reland fix text selection offset in multi-line fields (flutter/flutter#166714) 2025-04-07 [email protected] [flutter_tools] Update dwds version to 24.3.10 (flutter/flutter#166699) 2025-04-07 [email protected] Roll Skia from 5f0f9b76b975 to f493d403c01b (3 revisions) (flutter/flutter#166710) 2025-04-07 [email protected] Roll HarfBuzz to 11.0.0 (flutter/flutter#166596) 2025-04-07 [email protected] Fix: CupertinoSheetTransition moves SystemUIOverlayStyle to outside of delegatedTransition and only changes top bar (flutter/flutter#164680) 2025-04-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Reverts "Remove `bringup:true` from Linux tool_tests_widget_preview_scaffold (#166687)" (#166700)" (flutter/flutter#166711) 2025-04-07 [email protected] [ Widget Preview ] Update generated test files (flutter/flutter#166701) 2025-04-07 [email protected] Roll Skia from 339ef4f48c29 to 5f0f9b76b975 (1 revision) (flutter/flutter#166690) 2025-04-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Remove `bringup:true` from Linux tool_tests_widget_preview_scaffold (#166687)" (flutter/flutter#166700) 2025-04-07 [email protected] [reland] Convert the Flutter Gradle Plugin entirely to Kotlin source (flutter/flutter#166676) 2025-04-07 [email protected] Remove `bringup:true` from Linux tool_tests_widget_preview_scaffold (flutter/flutter#166687) 2025-04-07 [email protected] [Widget Preview] implemented gridview and listview layouts (flutter/flutter#166150) 2025-04-07 [email protected] Roll Skia from 966d9c665eed to 339ef4f48c29 (1 revision) (flutter/flutter#166680) 2025-04-07 [email protected] Roll Skia from 8505be5b584e to 966d9c665eed (2 revisions) (flutter/flutter#166675) 2025-04-07 [email protected] Feat: Add yearShape property to DatePickerThemeData (flutter/flutter#163909) 2025-04-07 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Convert the Flutter Gradle Plugin entirely to Kotlin source (#166114)" (flutter/flutter#166666) 2025-04-07 [email protected] Convert the Flutter Gradle Plugin entirely to Kotlin source (flutter/flutter#166114) 2025-04-06 [email protected] Make coverage collection aware of workspaces (flutter/flutter#166389) 2025-04-06 [email protected] Roll Skia from da7929d79c28 to 8505be5b584e (1 revision) (flutter/flutter#166661) 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] 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 ...
…lutter#165557) <!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> fixes flutter#140701 This PR fixes an issue where a DraggableScrollableSheet with `snap` set to true and `shouldCloseOnMinExtent` set to true may not close when dragged downward. The issue was caused by round-off errors accumulated by `addPixelDelta` method, which could lead to `extent.currentSize` not matching the `extent.minSize` exactly when the bottom is reached. I added logic to correct it when the snapping ballistic animation is complete. <details> <summary>Sample code</summary> ```Dart import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @OverRide Widget build(BuildContext context) { return MaterialApp( home: HomePage(), ); } } class HomePage extends StatelessWidget { const HomePage({super.key}); @OverRide Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("DraggableScrollableSheet Test"), ), body: Center( child: ElevatedButton( child: Text("Open"), onPressed: () { showModalBottomSheet( context: context, showDragHandle: true, isScrollControlled: true, builder: (context) => _buildBottomSheet(), ); }, ), ), ); } Widget _buildBottomSheet() { return NotificationListener<DraggableScrollableNotification>( onNotification: (notification) { print(notification.extent); return false; }, child: DraggableScrollableSheet( expand: false, snap: true, shouldCloseOnMinExtent: true, maxChildSize: 0.9, minChildSize: 0.25, builder: (context, scrollController) { return ListView.builder( controller: scrollController, itemCount: 100, itemBuilder: (context, index) { return ListTile( title: Text("Item $index"), ); }, ); }, ), ); } } ``` </details> | Before applying fix | After | | --- | --- | | * Occurs with probability <video src="proxy.php?url=https://github.com/user-attachments/assets/ffd2d097-3ed5-4775-90d5-950092d49591"> | <video src="proxy.php?url=https://github.com/user-attachments/assets/0f20cb81-3444-40a3-a84d-ed4bff15887e"> | ## 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. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#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/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
|
Hello, how do you know this is on stable version or not ? Based on this PR, I only know if it's on master branch. |
|
@Kiruel I think this is included in 3.32 release. https://docs.flutter.dev/release/release-notes/release-notes-3.32.0 |
fixes #140701
This PR fixes an issue where a DraggableScrollableSheet with
snapset to true andshouldCloseOnMinExtentset to true may not close when dragged downward.The issue was caused by round-off errors accumulated by
addPixelDeltamethod, which could lead toextent.currentSizenot matching theextent.minSizeexactly when the bottom is reached. I added logic to correct it when the snapping ballistic animation is complete.Sample code
Simulator.Screen.Recording.-.iPhone.16.-.2025-03-21.at.01.04.18.mp4
Simulator.Screen.Recording.-.iPhone.16.-.2025-03-21.at.01.05.08.mp4
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.