Commit 03e89392 authored by Hans Muller's avatar Hans Muller

Fix PageableList demo

parent 37f685b4
......@@ -131,11 +131,19 @@ class PageableListState<T, Config extends PageableList<T>> extends ScrollableSta
);
}
ScrollBehavior createScrollBehavior() {
return config.itemsWrap ? new UnboundedBehavior() : new OverscrollBehavior();
UnboundedBehavior _unboundedBehavior;
OverscrollBehavior _overscrollBehavior;
ExtentScrollBehavior get scrollBehavior {
if (config.itemsWrap) {
_unboundedBehavior ??= new UnboundedBehavior();
return _unboundedBehavior;
}
_overscrollBehavior ??= new OverscrollBehavior();
return _overscrollBehavior;
}
ExtentScrollBehavior get scrollBehavior => super.scrollBehavior;
ScrollBehavior createScrollBehavior() => scrollBehavior;
bool get snapScrollOffsetChanges => config.itemsSnapAlignment == ItemsSnapAlignment.item;
......
......@@ -197,18 +197,6 @@ abstract class ScrollableState<T extends Scrollable> extends State<T> {
}
Simulation _createFlingSimulation(double velocity) {
/*
// Assume that we're rendering at atleast 15 FPS. Stop when we're
// scrolling less than one logical pixel per frame. We're essentially
// normalizing by the devicePixelRatio so that the threshold has the
// same effect independent of the device's pixel density.
double endVelocity = pixelToScrollOffset(15.0 * ui.window.devicePixelRatio);
// Similar to endVelocity. Stop scrolling when we're this close to
// destiniation scroll offset.
double endDistance = pixelToScrollOffset(0.5 * ui.window.devicePixelRatio);
*/
final double endVelocity = pixelToScrollOffset(kPixelScrollTolerance.velocity);
final double endDistance = pixelToScrollOffset(kPixelScrollTolerance.distance);
return scrollBehavior.createFlingScrollSimulation(scrollOffset, velocity)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment