diff --git a/lib/src/controller/auto_animated_sliver_list_controller.dart b/lib/src/controller/auto_animated_sliver_list_controller.dart index 852e196..0e851f4 100644 --- a/lib/src/controller/auto_animated_sliver_list_controller.dart +++ b/lib/src/controller/auto_animated_sliver_list_controller.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import '../extensions/extensions.dart'; @@ -315,7 +316,14 @@ class AutoAnimateSliverListController { } /// Do not use this method directly - void updateItems(List updatedItems) => _items = updatedItems; + void updateItems(List updatedItems) { + _items = updatedItems; + // Added ticket provider null check to avoid unnecessary updates + // during animations or when calling updateItemsWithAnimation + if (_tickerProvider == null && !listEquals(_items, _currentItems)) { + _currentItems = List.from(_items); + } + } /// Do not use this method directly void updateItemsWithAnimation({