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.

Constructors

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

Properties

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

Methods

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.
inherited
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.
inherited

Operators

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

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.