hide method

Future<void> hide({
  1. bool removeFromOverlay = true,
})

Schedules a hide of the magnifier.

If this MagnifierController has an AnimationController, then hide reverses the animation controller and waits for the animation to complete. Then, if removeFromOverlay is true, remove the magnifier from the overlay.

In general, removeFromOverlay should be true, unless the magnifier needs to preserve states between shows / hides.

See also:

Implementation

Future<void> hide({bool removeFromOverlay = true}) async {
  if (overlayEntry == null) {
    return;
  }

  if (animationController != null) {
    await animationController?.reverse();
  }

  if (removeFromOverlay) {
    this.removeFromOverlay();
  }
}