caretFlashPeriod static method

Duration caretFlashPeriod([
  1. Finder? superEditorFinder
])

Returns the Duration to switch the caret between visible and invisible.

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 Duration caretFlashPeriod([Finder? superEditorFinder]) {
  if (defaultTargetPlatform == TargetPlatform.android) {
    final androidCaretLayerState = _findAndroidControlsLayer(superEditorFinder);
    return androidCaretLayerState.caretFlashPeriod;
  }

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

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