toPercent method

Future<void> toPercent(
  1. double percent, {
  2. Duration duration = const Duration(milliseconds: 300),
  3. Curve curve = Curves.easeInOut,
})

Implementation

Future<void> toPercent(
  double percent, {
  Duration duration = const Duration(milliseconds: 300),
  Curve curve = Curves.easeInOut,
}) async {
  if (!hasClients) return;
  final target = position.maxScrollExtent * percent.clamp(0.0, 1.0);
  await animateTo(target, duration: duration, curve: curve);
}