quire-io / scroll-to-index

scroll to index with fixed/variable row height inside Flutter scrollable widget
MIT License
518 stars 105 forks source link

scroll to a index when empty ScrollTag state shouldn't cause exception #17

Closed jerrywell closed 4 years ago

jerrywell commented 4 years ago

this case is for some reason that scrolling to a index with the empty tagMap. part of stack trace:

E/flutter ( 2392): Receiver: null
E/flutter ( 2392): Tried calling: offset
E/flutter ( 2392): #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
E/flutter ( 2392): #1      AutoScrollControllerMixin._forecastMoveUnit (package:scroll_to_index/scroll_to_index.dart:329:61)
E/flutter ( 2392): #2      AutoScrollControllerMixin._scrollToIndex (package:scroll_to_index/scroll_to_index.dart:251:28)
E/flutter ( 2392): <asynchronous suspension>
E/flutter ( 2392): #3      AutoScrollControllerMixin.scrollToIndex.<anonymous closure> (package:scroll_to_index/scroll_to_index.dart:195:27)
E/flutter ( 2392): #4      co (package:scroll_to_index/util.dart:37:26)
E/flutter ( 2392): #5      AutoScrollControllerMixin.scrollToIndex (package:scroll_to_index/scroll_to_index.dart:195:12)