From b22fe59b0f6c14836bde4e03979384d472544ade Mon Sep 17 00:00:00 2001 From: hwkim1127 <41946383+hwkim1127@users.noreply.github.com> Date: Fri, 5 Jan 2024 02:06:03 +0900 Subject: [PATCH] Null check operator fix This fixes "Unhandled Exception: Null check operator used on a null value" when items in the ScrollablePositionedList are dynamically created or deleted. --- .../lib/src/scrollable_positioned_list.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/scrollable_positioned_list/lib/src/scrollable_positioned_list.dart b/packages/scrollable_positioned_list/lib/src/scrollable_positioned_list.dart index 60045e9b..6995bde8 100644 --- a/packages/scrollable_positioned_list/lib/src/scrollable_positioned_list.dart +++ b/packages/scrollable_positioned_list/lib/src/scrollable_positioned_list.dart @@ -217,7 +217,7 @@ class ItemScrollController { /// * 1 aligns the left edge of the item with the right edge of the view. /// * 0.5 aligns the left edge of the item with the center of the view. void jumpTo({required int index, double alignment = 0}) { - _scrollableListState!._jumpTo(index: index, alignment: alignment); + _scrollableListState?._jumpTo(index: index, alignment: alignment); } /// Animate the list over [duration] using the given [curve] such that the