fix: guard scrollListToIndex against multiple scroll positions
This commit is contained in:
@@ -23,7 +23,7 @@ void scrollListToIndex(
|
||||
double leadingPadding = 12.0,
|
||||
bool animate = true,
|
||||
}) {
|
||||
if (!controller.hasClients || itemExtent <= 0) return;
|
||||
if (controller.positions.length != 1 || itemExtent <= 0) return;
|
||||
|
||||
final viewport = controller.position.viewportDimension;
|
||||
final targetCenter = leadingPadding + (index * itemExtent) + (itemExtent / 2);
|
||||
|
||||
Reference in New Issue
Block a user