|
|
|
|
|
|
Brightness? keyboardAppearance = Brightness.light, |
|
|
|
DragStartBehavior dragStartBehavior = DragStartBehavior.down, |
|
|
|
bool? enableInteractiveSelection = null, |
|
|
|
ScrollPhysics scrollPhysics = null |
|
|
|
ScrollPhysics scrollPhysics = null, |
|
|
|
Func<RawKeyEvent, bool> globalCtrlKeyEventHandler = null |
|
|
|
) : base(key) { |
|
|
|
D.assert(controller != null); |
|
|
|
D.assert(focusNode != null); |
|
|
|
|
|
|
this.enableInteractiveSelection = enableInteractiveSelection; |
|
|
|
this.dragStartBehavior = dragStartBehavior; |
|
|
|
this.scrollPhysics = scrollPhysics; |
|
|
|
this.globalKeyEventHandler = globalCtrlKeyEventHandler; |
|
|
|
} |
|
|
|
|
|
|
|
public readonly TextEditingController controller; |
|
|
|
|
|
|
public readonly DragStartBehavior dragStartBehavior; |
|
|
|
public readonly bool? enableInteractiveSelection; |
|
|
|
public readonly ScrollPhysics scrollPhysics; |
|
|
|
public readonly Func<RawKeyEvent, bool> globalKeyEventHandler; |
|
|
|
|
|
|
|
public bool selectionEnabled { |
|
|
|
get { return this.enableInteractiveSelection ?? !this.obscureText; } |
|
|
|
|
|
|
paintCursorAboveText: this.widget.paintCursorAboveText, |
|
|
|
enableInteractiveSelection: this.widget.enableInteractiveSelection == true, |
|
|
|
textSelectionDelegate: this, |
|
|
|
devicePixelRatio: this._devicePixelRatio |
|
|
|
devicePixelRatio: this._devicePixelRatio, |
|
|
|
globalKeyEventHandler: this.widget.globalKeyEventHandler |
|
|
|
) |
|
|
|
) |
|
|
|
); |
|
|
|
|
|
|
public readonly TextSelectionDelegate textSelectionDelegate; |
|
|
|
public readonly bool? paintCursorAboveText; |
|
|
|
public readonly float? devicePixelRatio; |
|
|
|
public readonly Func<RawKeyEvent, bool> globalKeyEventHandler; |
|
|
|
|
|
|
|
|
|
|
|
public _Editable(TextSpan textSpan = null, |
|
|
|
|
|
|
Offset cursorOffset = null, |
|
|
|
bool enableInteractiveSelection = true, |
|
|
|
bool? paintCursorAboveText = null, |
|
|
|
float? devicePixelRatio = null) : base(key) { |
|
|
|
float? devicePixelRatio = null, |
|
|
|
Func<RawKeyEvent, bool> globalKeyEventHandler = null) : base(key) { |
|
|
|
this.textSpan = textSpan; |
|
|
|
this.value = value; |
|
|
|
this.cursorColor = cursorColor; |
|
|
|
|
|
|
this.enableInteractiveSelection = enableInteractiveSelection; |
|
|
|
this.paintCursorAboveText = paintCursorAboveText; |
|
|
|
this.devicePixelRatio = devicePixelRatio; |
|
|
|
this.globalKeyEventHandler = globalKeyEventHandler; |
|
|
|
} |
|
|
|
|
|
|
|
public override RenderObject createRenderObject(BuildContext context) { |
|
|
|
|
|
|
enableInteractiveSelection: this.enableInteractiveSelection, |
|
|
|
textSelectionDelegate: this.textSelectionDelegate, |
|
|
|
paintCursorAboveText: this.paintCursorAboveText == true, |
|
|
|
devicePixelRatio: this.devicePixelRatio ?? 1.0f |
|
|
|
devicePixelRatio: this.devicePixelRatio ?? 1.0f, |
|
|
|
globalKeyEventHandler: this.globalKeyEventHandler |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
edit.enableInteractiveSelection = this.enableInteractiveSelection; |
|
|
|
edit.paintCursorAboveText = this.paintCursorAboveText == true; |
|
|
|
edit.devicePixelRatio = this.devicePixelRatio ?? 1.0f; |
|
|
|
edit.globalKeyEventHandler = this.globalKeyEventHandler; |
|
|
|
} |
|
|
|
} |
|
|
|
} |