|
@@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
|
|
|
import 'package:flutter/rendering.dart';
|
|
import 'package:flutter/rendering.dart';
|
|
|
import 'package:flutter/services.dart';
|
|
import 'package:flutter/services.dart';
|
|
|
import 'package:xterm/src/core/buffer/cell_offset.dart';
|
|
import 'package:xterm/src/core/buffer/cell_offset.dart';
|
|
|
-
|
|
|
|
|
import 'package:xterm/src/core/input/keys.dart';
|
|
import 'package:xterm/src/core/input/keys.dart';
|
|
|
import 'package:xterm/src/terminal.dart';
|
|
import 'package:xterm/src/terminal.dart';
|
|
|
import 'package:xterm/src/ui/controller.dart';
|
|
import 'package:xterm/src/ui/controller.dart';
|
|
@@ -163,8 +162,7 @@ class TerminalViewState extends State<TerminalView> {
|
|
|
|
|
|
|
|
late ScrollController _scrollController;
|
|
late ScrollController _scrollController;
|
|
|
|
|
|
|
|
- RenderTerminal get renderTerminal =>
|
|
|
|
|
- _viewportKey.currentContext!.findRenderObject() as RenderTerminal;
|
|
|
|
|
|
|
+ RenderTerminal get renderTerminal => _viewportKey.currentContext!.findRenderObject() as RenderTerminal;
|
|
|
|
|
|
|
|
@override
|
|
@override
|
|
|
void initState() {
|
|
void initState() {
|
|
@@ -265,7 +263,8 @@ class TerminalViewState extends State<TerminalView> {
|
|
|
onComposing: _onComposing,
|
|
onComposing: _onComposing,
|
|
|
onAction: (action) {
|
|
onAction: (action) {
|
|
|
_scrollToBottom();
|
|
_scrollToBottom();
|
|
|
- if (action == TextInputAction.done) {
|
|
|
|
|
|
|
+ // Android sends TextInputAction.newline when the user presses the virtual keyboard's enter key.
|
|
|
|
|
+ if (action == TextInputAction.done || action == TextInputAction.newline) {
|
|
|
widget.terminal.keyInput(TerminalKey.enter);
|
|
widget.terminal.keyInput(TerminalKey.enter);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -301,10 +300,8 @@ class TerminalViewState extends State<TerminalView> {
|
|
|
terminalController: _controller,
|
|
terminalController: _controller,
|
|
|
onTapUp: _onTapUp,
|
|
onTapUp: _onTapUp,
|
|
|
onTapDown: _onTapDown,
|
|
onTapDown: _onTapDown,
|
|
|
- onSecondaryTapDown:
|
|
|
|
|
- widget.onSecondaryTapDown != null ? _onSecondaryTapDown : null,
|
|
|
|
|
- onSecondaryTapUp:
|
|
|
|
|
- widget.onSecondaryTapUp != null ? _onSecondaryTapUp : null,
|
|
|
|
|
|
|
+ onSecondaryTapDown: widget.onSecondaryTapDown != null ? _onSecondaryTapDown : null,
|
|
|
|
|
+ onSecondaryTapUp: widget.onSecondaryTapUp != null ? _onSecondaryTapUp : null,
|
|
|
readOnly: widget.readOnly,
|
|
readOnly: widget.readOnly,
|
|
|
child: child,
|
|
child: child,
|
|
|
);
|
|
);
|
|
@@ -336,8 +333,7 @@ class TerminalViewState extends State<TerminalView> {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Rect get globalCursorRect {
|
|
Rect get globalCursorRect {
|
|
|
- return renderTerminal.localToGlobal(renderTerminal.cursorOffset) &
|
|
|
|
|
- renderTerminal.cellSize;
|
|
|
|
|
|
|
+ return renderTerminal.localToGlobal(renderTerminal.cursorOffset) & renderTerminal.cellSize;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void _onTapUp(TapUpDetails details) {
|
|
void _onTapUp(TapUpDetails details) {
|