ente/lib/ui/common/fast_scroll_physics.dart
Neeraj Gupta 5c9c3531ab Fix: Increase page scroll speed
Signed-off-by: Neeraj Gupta <254676+ua741@users.noreply.github.com>
2023-08-30 09:49:53 +05:30

25 lines
599 B
Dart

import 'package:flutter/material.dart';
class FastScrollPhysics extends PageScrollPhysics {
final double speedFactor;
const FastScrollPhysics({this.speedFactor = 2.0, ScrollPhysics? parent})
: super(parent: parent);
@override
FastScrollPhysics applyTo(ScrollPhysics? ancestor) {
return FastScrollPhysics(
speedFactor: speedFactor,
parent: buildParent(ancestor),
);
}
@override
Simulation? createBallisticSimulation(
ScrollMetrics position,
double velocity,
) {
return super.createBallisticSimulation(position, velocity * speedFactor);
}
}