From d10a912aae1fb0da330d9c83169f15ed2b0b42a2 Mon Sep 17 00:00:00 2001 From: adrianostas Date: Fri, 10 Feb 2023 09:39:55 +0200 Subject: [PATCH] fix Scrollable of context for nullable instance --- lib/src/scrolling_behavior.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/scrolling_behavior.dart b/lib/src/scrolling_behavior.dart index e8fb29ca..b5860bad 100644 --- a/lib/src/scrolling_behavior.dart +++ b/lib/src/scrolling_behavior.dart @@ -58,7 +58,7 @@ class _SlidableScrollingBehaviorState extends State { void addScrollingNotifierListener() { if (widget.closeOnScroll) { - scrollPosition = Scrollable.of(context)?.position; + scrollPosition = Scrollable.maybeOf(context)?.position; if (scrollPosition != null) { scrollPosition!.isScrollingNotifier.addListener(handleScrollingChanged); }