I have a simple PageView:
PageView(
controller: _pageController,
physics: PlatformScrollPhysics.getPlatformScrollPhysics(),
children: [
Text("I am
cs guy's answer is right on track. Also credit to pskink.The PageView widget's transition speed isn't based on an animation curve even though the programmatic approach is.
PageView actually uses a Spring Simulation to handle the page transitions when used with swiping, so the "physics" property has to be overridden to change the "animation speed".
Here is a simple way to increase the "animation speed" by using custom Scroll Physics class.
import 'package:flutter/cupertino.dart';
import 'package:flutter/physics.dart';
class CustomPageViewScrollPhysics extends ScrollPhysics {
const CustomPageViewScrollPhysics({ScrollPhysics parent})
: super(parent: parent);
@override
CustomPageViewScrollPhysics applyTo(ScrollPhysics ancestor) {
return CustomPageViewScrollPhysics(parent: buildParent(ancestor));
}
@override
SpringDescription get spring => const SpringDescription(
mass: 80,
stiffness: 100,
damping: 1,
);
}
It can be used in the PageView constructor like this:
PageView(... physics: const CustomPageViewScrollPhysics(),)
And feel free to adjust any of the spring parameters!