|
|
|
|
|
|
bool cursorOpacityAnimates = false, |
|
|
|
Offset cursorOffset = null, |
|
|
|
bool paintCursorAboveText = false, |
|
|
|
ui.BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight, |
|
|
|
ui.BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight, |
|
|
|
BoxHeightStyle selectionHeightStyle = BoxHeightStyle.tight, |
|
|
|
BoxWidthStyle selectionWidthStyle = BoxWidthStyle.tight, |
|
|
|
EdgeInsets scrollPadding = null, |
|
|
|
Brightness? keyboardAppearance = Brightness.light, |
|
|
|
DragStartBehavior dragStartBehavior = DragStartBehavior.start, |
|
|
|
|
|
|
public readonly VoidCallback onSelectionHandleTapped; |
|
|
|
public readonly ScrollController scrollController; |
|
|
|
public readonly bool showCursor; |
|
|
|
public readonly ui.BoxHeightStyle selectionHeightStyle; |
|
|
|
public readonly ui.BoxWidthStyle selectionWidthStyle; |
|
|
|
public readonly BoxHeightStyle selectionHeightStyle; |
|
|
|
public readonly BoxWidthStyle selectionWidthStyle; |
|
|
|
public readonly bool forceLine; |
|
|
|
public readonly bool showSelectionHandles ; |
|
|
|
public readonly ToolbarOptions toolbarOptions; |
|
|
|
|
|
|
|
|
|
|
void _didChangeTextEditingValue() { |
|
|
|
_updateRemoteEditingValueIfNeeded(); |
|
|
|
//_updateImePosIfNeed();
|
|
|
|
_updateImePosIfNeed(); |
|
|
|
_startOrStopCursorTimerIfNeeded(); |
|
|
|
_updateOrDisposeSelectionOverlayIfNeeded(); |
|
|
|
_textChangedSinceLastCaretUpdate = true; |
|
|
|
|
|
|
return TouchScreenKeyboard.isSupported && widget.unityTouchKeyboard; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Offset _getImePos() { |
|
|
|
if (_hasInputConnection && _textInputConnection.imeRequired()) { |
|
|
|
var localPos = renderEditable.getLocalRectForCaret(_value.selection.basePos).bottomLeft; |
|
|
|
return renderEditable.localToGlobal(localPos); |
|
|
|
} |
|
|
|
|
|
|
|
return null; |
|
|
|
} |
|
|
|
void _updateImePosIfNeed() { |
|
|
|
if (!_hasInputConnection || !_textInputConnection.imeRequired()) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (_imePosUpdateScheduled) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
_imePosUpdateScheduled = true; |
|
|
|
SchedulerBinding.instance.addPostFrameCallback(_ => { |
|
|
|
_imePosUpdateScheduled = false; |
|
|
|
if (!_hasInputConnection) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
_textInputConnection.setIMEPos(_getImePos()); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
public readonly float? cursorWidth; |
|
|
|
public readonly Radius cursorRadius; |
|
|
|
public readonly Offset cursorOffset; |
|
|
|
public readonly ui.BoxHeightStyle selectionHeightStyle; |
|
|
|
public readonly ui.BoxWidthStyle selectionWidthStyle; |
|
|
|
public readonly BoxHeightStyle selectionHeightStyle; |
|
|
|
public readonly BoxWidthStyle selectionWidthStyle; |
|
|
|
public readonly bool enableInteractiveSelection; |
|
|
|
public readonly TextSelectionDelegate textSelectionDelegate; |
|
|
|
public readonly bool? paintCursorAboveText; |
|
|
|
|
|
|
Radius cursorRadius = null, |
|
|
|
Offset cursorOffset = null, |
|
|
|
bool? paintCursorAboveText = null, |
|
|
|
ui.BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight, |
|
|
|
ui.BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight, |
|
|
|
BoxHeightStyle selectionHeightStyle = BoxHeightStyle.tight, |
|
|
|
BoxWidthStyle selectionWidthStyle = BoxWidthStyle.tight, |
|
|
|
bool enableInteractiveSelection = true, |
|
|
|
TextSelectionDelegate textSelectionDelegate = null, |
|
|
|
float? devicePixelRatio = null |
|
|
|