Skip to content

Commit

Permalink
Merge pull request #3 from Hari-07/patchResizeMaxHeight
Browse files Browse the repository at this point in the history
  • Loading branch information
apackin authored Aug 7, 2024
2 parents 241a879 + c0b4b5b commit 92c6238
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions sheet/lib/src/scrollable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ class SheetState extends State<SheetScrollable>
return newPhysics.shouldReload(oldPhysics);
}

bool _shouldUpdatePosition(SheetScrollable oldWidget) {
bool _shouldUpdatePositionBasedOnPhysics(SheetScrollable oldWidget) {
ScrollPhysics? newPhysics =
widget.physics ?? widget.scrollBehavior?.getScrollPhysics(context);
ScrollPhysics? oldPhysics = oldWidget.physics ??
Expand All @@ -419,6 +419,16 @@ class SheetState extends State<SheetScrollable>
return widget.controller?.runtimeType != oldWidget.controller?.runtimeType;
}

bool _shouldUpdatePositionBasedOnInitialExtent(SheetScrollable oldWidget) {
return widget.initialExtent != oldWidget.initialExtent;
// return false;
}

bool _shouldUpdatePosition(SheetScrollable oldWidget) {
return _shouldUpdatePositionBasedOnPhysics(oldWidget) ||
_shouldUpdatePositionBasedOnInitialExtent(oldWidget);
}

@override
void didUpdateWidget(SheetScrollable oldWidget) {
super.didUpdateWidget(oldWidget);
Expand Down Expand Up @@ -775,7 +785,7 @@ class _ScrollSemantics extends SingleChildRenderObjectWidget {
required this.allowImplicitScrolling,
required this.semanticChildCount,
super.child,
}) : assert(semanticChildCount == null || semanticChildCount >= 0);
}) : assert(semanticChildCount == null || semanticChildCount >= 0);

final ScrollPosition position;
final bool allowImplicitScrolling;
Expand Down

0 comments on commit 92c6238

Please sign in to comment.