MagnifierController class

MagnifierController's main benefit over holding a raw OverlayEntry is that MagnifierController will handle logic around waiting for a magnifier to animate in or out.

If a magnifier chooses to have an entry / exit animation, it should provide the animation controller to MagnifierController.animationController. MagnifierController will then drive the AnimationController and wait for it to be complete before removing it from the Overlay.

To check the status of the magnifier, see MagnifierController.shown.


MagnifierController({AnimationController? animationController})
If there is no in / out animation for the magnifier, animationController should be left null.


animationController AnimationController?
The controller that will be driven in / out when show / hide is triggered, respectively.
read / write
hashCode int
The hash code for this object.
overlayEntry OverlayEntry?
The magnifier's OverlayEntry, if currently in the overlay.
runtimeType Type
A representation of the runtime type of the object.
shown bool
If the magnifier is shown or not.


hide({bool removeFromOverlay = true}) Future<void>
Schedules a hide of the magnifier.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
removeFromOverlay() → void
Remove the OverlayEntry from the Overlay.
show({required BuildContext context, required WidgetBuilder builder, Widget? debugRequiredFor, OverlayEntry? below}) Future<void>
Shows the RawMagnifier that this controller controls.
toString() String
A string representation of this object.


operator ==(Object other) bool
The equality operator.

Static Methods

shiftWithinBounds({required Rect rect, required Rect bounds}) Rect
A utility for calculating a new Rect from rect such that rect is fully constrained within bounds.