wantsMobileMagnifierToBeVisible static method
Returns true
if SuperEditor's policy believes that a mobile magnifier
should be visible right now, or false
otherwise.
This inspection is different from isMobileMagnifierVisible in a couple ways:
- On mobile web, SuperEditor defers to the browser's built-in overlay
controls. Therefore, wantsMobileMagnifierToBeVisible is
true
but isMobileMagnifierVisible isfalse
. - When an app customizes the magnifier, SuperEditor might want to build
and display a magnifier, but the app overrode the magnifier widget and chose
to build empty space instead of a magnifier. In this case
wantsMobileMagnifierToBeVisible is
true
, but isMobileMagnifierVisible isfalse
.
Implementation
static bool wantsMobileMagnifierToBeVisible([Finder? superEditorFinder]) {
switch (defaultTargetPlatform) {
case TargetPlatform.android:
final magnifierManager = find.state<SuperEditorAndroidControlsOverlayManagerState>(superEditorFinder);
if (magnifierManager == null) {
throw Exception(
"Tried to verify that SuperEditor wants mobile magnifier to be visible on Android, but couldn't find the magnifier manager widget.");
}
return magnifierManager.wantsToDisplayMagnifier;
case TargetPlatform.iOS:
final magnifierManager = find.state<SuperEditorIosMagnifierOverlayManagerState>(superEditorFinder);
if (magnifierManager == null) {
throw Exception(
"Tried to verify that SuperEditor wants mobile magnifier to be visible on iOS, but couldn't find the magnifier manager widget.");
}
return magnifierManager.wantsToDisplayMagnifier;
case TargetPlatform.macOS:
case TargetPlatform.windows:
case TargetPlatform.linux:
case TargetPlatform.fuchsia:
return false;
}
}