Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the bottom sheet closing logic in bottom_sheet.dart and scaffold.dart to use precisionErrorTolerance when comparing the current extent to the minimum extent, and adds corresponding tests. The review feedback suggests that using absolute difference (.abs() < precisionErrorTolerance) may fail to close the bottom sheet if the extent drops below the minimum, and recommends using notification.extent - notification.minExtent <= precisionErrorTolerance to safely handle both nearly-equal and less-than cases.
|
Closed cause created port in flutter/packages here |
Hi @QuncCccccc ! Thanks for the guidance. |
Right, sorry for the inconvenience since at that time |
…uldCloseOnMinExtent Port of flutter/flutter#190810.
…Extent (#12545) This PR ports flutter/flutter#190810 by @kirya355 from flutter/flutter to flutter/packages. Fixes bottom sheet dismissal when a `DraggableScrollableNotification` extent is within floating-point precision of `minExtent`, instead of requiring exact equality. Updates both the modal `BottomSheet` and standard `Scaffold` bottom sheet handlers. Adds regression tests for both paths using `extent: 0.20000000001` and `minExtent: 0.2`. This PR fix [flutter/flutter#116982](flutter/flutter#116982) ## Pre-Review Checklist
I saw material is freezed but after this answer I reopened PR
flutter/packages#12392 (comment)
Fixes bottom sheet dismissal when a
DraggableScrollableNotificationextentis within floating-point precision of
minExtent, rather than exactly equal.Updates both
BottomSheetandScaffoldnotification handlers and addsregression tests for modal and standard bottom sheets using
extent: 0.20000000001withminExtent: 0.2.Tests
bin/flutter test packages/flutter/test/material/bottom_sheet_test.dartPre-launch Checklist
///).