getTargetPageForCurrent method

  1. @override
double getTargetPageForCurrent(
  1. double focusPage,
  2. DayOfWeek firstDayOfWeek,
  3. {double velocity = 0,
  4. Tolerance tolerance = Tolerance.defaultTolerance}
)
override

Gets the page to align to the viewport's left side based on the currentPage in that position.

Implementation

@override
double getTargetPageForCurrent(
  double focusPage,
  DayOfWeek firstDayOfWeek, {
  double velocity = 0,
  Tolerance tolerance = Tolerance.defaultTolerance,
}) {
  assert(focusPage != null);
  assert(firstDayOfWeek != null);
  assert(velocity != null);
  assert(tolerance != null);

  final velocityAddition = getDefaultVelocityAddition(velocity, tolerance);
  return (focusPage + velocityAddition).roundToDouble();
}