Skip to content

Commit

Permalink
Merge pull request #3 from tappeddev/fix_can_drag
Browse files Browse the repository at this point in the history
fix canDrag
  • Loading branch information
stefanschaller authored Mar 14, 2024
2 parents 6a54c35 + 1f96c6a commit 9f0fdda
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/scrollable_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class ScrollableBottomSheet extends StatefulWidget {
class ScrollableBottomSheetState extends State<ScrollableBottomSheet>
with SingleTickerProviderStateMixin {
final _scrollController = ScrollController();
late AnimationController _animationController;
late final AnimationController _animationController;
var _isScrollingEnabled = false;
var _isScrollingBlocked = false;

Expand Down Expand Up @@ -202,6 +202,10 @@ class ScrollableBottomSheetState extends State<ScrollableBottomSheet>
// region animation and scroll

void _onScroll() {
// No need to do anything when [canDrag] is disabled, since the list scrolls
// by default without any calls from our implementation.
if (!widget.canDrag) return;

if (!_isScrollingEnabled || _isScrollingBlocked) {
_scrollController.jumpTo(0);
}
Expand Down

0 comments on commit 9f0fdda

Please sign in to comment.