enableFakeHero property

bool enableFakeHero
final

Determines whether we draw a "fake" hero widget or not. If this is set to true we need to hide the fake hero by ourself like below

return Navigator.push<T?>(
  context,
  PageRouteBuilder(
    opaque: false,
    transitionDuration: duration,
    reverseTransitionDuration: duration,
    transitionsBuilder: (context, animation, secondaryAnimation, child) {
      return FadeTransition(
        opacity: animation,
        child: child,
      );
    },
    pageBuilder: (context, animation, secondaryAnimation) {
      void animationStatusListener(AnimationStatus status) {
        if (status == AnimationStatus.completed) {
          if (cropRotateEditor.currentState != null) {
            /// Remove the fake hero like that
            cropRotateEditor.currentState!.hideFakeHero();
          }
        } else if (status == AnimationStatus.dismissed) {
          animation.removeStatusListener(animationStatusListener);
        }
      }
      animation.addStatusListener(animationStatusListener);
      return page;
    },
  ),
);

Implementation

final bool enableFakeHero;