Unverified Commit c262126c authored by xubaolin's avatar xubaolin Committed by GitHub

Fix DraggableScrollableSheet and ListView has tiny scroll of one pixel (#109081)

parent e527dcea
......@@ -538,8 +538,6 @@ class _DraggableSheetExtent {
double get currentSize => _currentSize.value;
double get currentPixels => sizeToPixels(_currentSize.value);
double get additionalMinSize => isAtMin ? 0.0 : 1.0;
double get additionalMaxSize => isAtMax ? 0.0 : 1.0;
List<double> get pixelSnapSizes => snapSizes.map(sizeToPixels).toList();
/// Start an activity that affects the sheet and register a cancel call back
......@@ -795,7 +793,7 @@ class _DraggableScrollableSheetScrollController extends ScrollController {
ScrollPosition? oldPosition,
) {
return _DraggableScrollableSheetScrollPosition(
physics: physics,
physics: const AlwaysScrollableScrollPhysics().applyTo(physics),
context: context,
oldPosition: oldPosition,
getExtent: () => extent,
......@@ -887,17 +885,6 @@ class _DraggableScrollableSheetScrollPosition extends ScrollPositionWithSingleCo
super.beginActivity(newActivity);
}
@override
bool applyContentDimensions(double minScrollSize, double maxScrollSize) {
// We need to provide some extra size if we haven't yet reached the max or
// min sizes. Otherwise, a list with fewer children than the size of
// the available space will get stuck.
return super.applyContentDimensions(
minScrollSize - extent.additionalMinSize,
maxScrollSize + extent.additionalMaxSize,
);
}
@override
void applyUserOffset(double delta) {
if (!listShouldScroll &&
......
......@@ -879,7 +879,6 @@ void main() {
children: <TestSemantics>[
TestSemantics(
flags: <SemanticsFlag>[SemanticsFlag.hasImplicitScrolling],
actions: <SemanticsAction>[SemanticsAction.scrollDown, SemanticsAction.scrollUp],
children: <TestSemantics>[
TestSemantics(
label: 'BottomSheet',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment