fix(bottom_sheet): fix dismissal near minimum extent when shouldCloseOnMinExtent- #190705 - #190810
fix(bottom_sheet): fix dismissal near minimum extent when shouldCloseOnMinExtent- #190705#190810kirya355 wants to merge 1 commit into
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. |
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
///).