skew method

Future<void> skew(
  1. double amount, {
  2. Duration? duration,
  3. Curve? curve,
})

Skew by amount percentage (0 - 1.0) This can be used with a MouseRegion to indicate that the card can be flipped. skew(0) to go back to original. If awaited, returns after animation completes.

Implementation

Future<void> skew(double amount, {Duration? duration, Curve? curve}) async {
  assert(0 <= amount && amount <= 1);
  final target = isFront ? amount : 1 - amount;
  await controller
      .animateTo(target, duration: duration, curve: curve ?? Curves.linear)
      .asStream()
      .first;
}