wantsMobileMagnifierToBeVisible static method

bool wantsMobileMagnifierToBeVisible([
  1. Finder? superEditorFinder
])

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:

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;
  }
}