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.
I have tried with above solutions but set ScrollController initialScrollOffset, checking hasClients and jumpTo, WidgetsBinding no one is working for me.
at last solved my problem by checking positions 'scrollcontroller.positions.length' like
if (_sc.positions.length == 0 || _sc.position.pixels == 0.0) {
return Container();
}
You have to check controller positions to get rid of the error
Reference : https://api.flutter.dev/flutter/widgets/ScrollController/position.html