build method

  1. @override
Widget build(
  1. BuildContext context,
  2. Widget child,
  3. AnimationController controller,
  4. EffectEntry entry,
)

Builds the widgets that implement the effect on the target child, based on the provided AnimationController and EffectEntry.

Implementation

@override
Widget build(
    BuildContext context,
    Widget child,
    AnimationController controller,
    EffectEntry entry,
    ) {
  Animation<Offset> animation = buildAnimation(controller, entry);
  return getOptimizedBuilder<Offset>(
    animation: animation,
    builder: (_, __) => Transform(
      transform: Matrix4.identity()
        ..setEntry(3, 2, 0.001)
        ..rotateX(animation.value.dx)
        ..rotateY(animation.value.dy),
      alignment: Alignment.center,
      child: child,
    ),
  );
}