showMagnifier method

void showMagnifier(
  1. Offset positionToShow
)

Shows the magnifier at the position given by positionToShow, if no magnifier exists.

Updates the magnifier to the position given by positionToShow, if a magnifier exits.

Does nothing if a magnifier couldn't be shown, such as when the selection overlay does not currently exist.

Implementation

void showMagnifier(Offset positionToShow) {
  if (_selectionOverlay == null) {
    return;
  }

  if (_selectionOverlay!.magnifierExists) {
    _selectionOverlay!.updateMagnifier(positionToShow);
  } else {
    _selectionOverlay!.showMagnifier(positionToShow);
  }
}