lerp static method

Implementation

static BlockAlignment? lerp(BlockAlignment? a, BlockAlignment? b, double t) {
  if (identical(a, b)) return a;

  if (a == null) {
    return BlockAlignment(
      ui.lerpDouble(0.0, b!.x, t)!,
      ui.lerpDouble(0.0, b.y, t)!,
      xEdgeAlignment: b.xEdgeAlignment,
      yEdgeAlignment: b.yEdgeAlignment,
    );
  }

  if (b == null) {
    return BlockAlignment(
      ui.lerpDouble(a.x, 0.0, t)!,
      ui.lerpDouble(a.y, 0.0, t)!,
      xEdgeAlignment: a.xEdgeAlignment,
      yEdgeAlignment: a.yEdgeAlignment,
    );
  }

  return BlockAlignment(
      ui.lerpDouble(a.x, b.x, t)!, ui.lerpDouble(a.y, b.y, t)!);
}