morphWidth static method

double morphWidth(
  1. double progress, {
  2. double cardWidthFraction = 0.85,
})

Card width as fraction of available width. At progress 0.0 → cardWidthFraction, at 1.0 → 1.0 (fullscreen).

Implementation

static double morphWidth(double progress, {double cardWidthFraction = 0.85}) {
  final t = progress.clamp(0.0, 1.0);
  return lerpDouble(cardWidthFraction, 1.0, t)!;
}