scrollToPositionIfNotAtTop method
Scrolls to the given position only if the position is not at the top already.
Implementation
Future<void> scrollToPositionIfNotAtTop(
double offset, {
Duration duration = const Duration(milliseconds: 300),
Curve curve = Curves.easeInOut,
}) {
if (!isAtTop) {
return animateToPosition(offset, duration: duration, curve: curve);
}
return Future.value();
}