mirror of
https://github.com/ente-io/ente.git
synced 2025-05-02 20:09:14 +00:00
24 lines
560 B
Dart
24 lines
560 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class FastScrollPhysics extends PageScrollPhysics {
|
|
final double speedFactor;
|
|
|
|
const FastScrollPhysics({this.speedFactor = 2.0, super.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);
|
|
}
|
|
}
|