MagnifierController class Null safety

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.
read / write
hashCode int
The hash code for this object.
read-onlyinherited
overlayEntry OverlayEntry?
The magnifier's OverlayEntry, if currently in the overlay.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
shown bool
If the magnifier is shown or not.
read-only

Methods

hide({bool removeFromOverlay = true}) Future<void>
Schedules a hide of the magnifier.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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.