wantsMobileToolbarToBeVisible static method

bool wantsMobileToolbarToBeVisible([
  1. Finder? superEditorFinder
])

Returns true if SuperEditor's policy believes that a mobile toolbar should be visible right now, or false otherwise.

This inspection is different from isMobileToolbarVisible in a couple ways:

Implementation

static bool wantsMobileToolbarToBeVisible([Finder? superEditorFinder]) {
  switch (defaultTargetPlatform) {
    case TargetPlatform.android:
      final toolbarManager = find.state<SuperEditorAndroidControlsOverlayManagerState>(superEditorFinder);
      if (toolbarManager == null) {
        throw Exception(
            "Tried to verify that SuperEditor wants mobile toolbar to be visible on Android, but couldn't find the toolbar manager widget.");
      }
      return toolbarManager.wantsToDisplayToolbar;
    case TargetPlatform.iOS:
      final toolbarManager = find.state<SuperEditorIosToolbarOverlayManagerState>(superEditorFinder);
      if (toolbarManager == null) {
        throw Exception(
            "Tried to verify that SuperEditor wants mobile toolbar to be visible on iOS, but couldn't find the toolbar manager widget.");
      }
      return toolbarManager.wantsToDisplayToolbar;
    case TargetPlatform.macOS:
    case TargetPlatform.windows:
    case TargetPlatform.linux:
    case TargetPlatform.fuchsia:
      return false;
  }
}