isCaretVisible static method

bool isCaretVisible([
  1. Finder? superEditorFinder
])

Returns true if the caret is currently visible and 100% opaque, or false if it's not.

By default, this method expects a single SuperEditor in the widget tree and finds it byType. To specify one SuperEditor among many, pass a superEditorFinder.

Implementation

static bool isCaretVisible([Finder? superEditorFinder]) {
  if (defaultTargetPlatform == TargetPlatform.android) {
    final androidCaretLayerState = _findAndroidControlsLayer(superEditorFinder);
    return androidCaretLayerState.isCaretVisible;
  }

  if (defaultTargetPlatform == TargetPlatform.iOS) {
    final iOSCaretLayer = _findIosControlsLayer(superEditorFinder);
    return iOSCaretLayer.isCaretVisible;
  }

  final desktopCaretLayer = _findDesktopCaretOverlay(superEditorFinder);
  return desktopCaretLayer.isCaretVisible;
}