From ec25c375ed152205d413d58046712cb31fd21ef6 Mon Sep 17 00:00:00 2001 From: Stefan Schaller Date: Tue, 12 Mar 2024 18:02:52 +0100 Subject: [PATCH] fix check --- lib/scrollable_bottom_sheet.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/scrollable_bottom_sheet.dart b/lib/scrollable_bottom_sheet.dart index 8b83650..00130bc 100644 --- a/lib/scrollable_bottom_sheet.dart +++ b/lib/scrollable_bottom_sheet.dart @@ -158,7 +158,9 @@ class ScrollableBottomSheetState extends State // _drag might be null if the drag activity ended and called _disposeDrag. assert(_hold == null || _drag == null); _drag?.update(details); - if (_scrollController.position.pixels <= 0 && details.primaryDelta! > 0) { + if (_scrollController.hasClients && + _scrollController.position.pixels <= 0 && + details.primaryDelta! > 0) { setState(() => _isScrollingEnabled = false); _handleDragCancel(); if (_scrollController.position.pixels != 0.0) {