clip static method

MotionWidgetBuilder clip({
  1. required Rect startAmount,
  2. required Rect endAmount,
})

Clips from the startAmount to endAmount.

Amount offsets are from 0 to 1 from left to right, or top to bottom. Amount sizes are from 0 to 1 for width and height.

Implementation

static MotionWidgetBuilder clip({
  required Rect startAmount,
  required Rect endAmount,
}) =>
    (
      BuildContext context,
      MontageAnimation current,
      Animation<double> animation,
      Widget? child,
    ) {
      return AnimatedBuilder(
        animation: animation,
        child: child,
        builder: (context, child) => ClipPath(
          clipper: _OpeningBoxClip(
            animation,
            startAmount,
            endAmount,
          ),
          child: child,
        ),
      );
    };