Issue
I'm using CustomScrollView, and providing it with a controller. ScrollController works, I even added a listener to it and print out the position of the scroll view.
CustomScrollView(
controller: _scrollController,
Now, all i'm trying to do is jump to position 50.0 inside initState() function.
_scrollController.jumpTo(50.0);
But, i get the error
scrollController not attached to any scroll views
Solution
Check if the scrollController is attached to a scroll view by using its hasClients property first.
if (_scrollController.hasClients)
_scrollController.jumpTo(50.0);
Answered By - Ed H
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.