trick way to make backspace work always
This commit is contained in:
parent
d75cdb7811
commit
7a2d687367
@ -68,7 +68,7 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
var v = MediaQuery.of(context).viewInsets.bottom;
|
var v = MediaQuery.of(context).viewInsets.bottom;
|
||||||
if (v != _bottom) {
|
if (v != _bottom) {
|
||||||
resetTool();
|
resetTool();
|
||||||
_value = '';
|
_value = ' ' * 1000;
|
||||||
setState(() {
|
setState(() {
|
||||||
_bottom = v;
|
_bottom = v;
|
||||||
if (v < 100) {
|
if (v < 100) {
|
||||||
@ -222,16 +222,18 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
height: 0,
|
height: 0,
|
||||||
child: _bottom < 100
|
child: _bottom < 100
|
||||||
? Container()
|
? Container()
|
||||||
: TextField(
|
: TextFormField(
|
||||||
textInputAction: TextInputAction.newline,
|
textInputAction: TextInputAction.newline,
|
||||||
autocorrect: false,
|
autocorrect: false,
|
||||||
enableSuggestions: false,
|
enableSuggestions: false,
|
||||||
focusNode: _focusNode,
|
focusNode: _focusNode,
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
|
initialValue:
|
||||||
|
_value, // trick way to make backspace work always
|
||||||
keyboardType: TextInputType.multiline,
|
keyboardType: TextInputType.multiline,
|
||||||
onChanged: (x) {
|
onChanged: (x) {
|
||||||
var char = x[x.length - 1];
|
var char = x[x.length - 1];
|
||||||
if (x.length < _value.length) {
|
if (x.length <= _value.length) {
|
||||||
char = 'VK_BACK';
|
char = 'VK_BACK';
|
||||||
} else if (char == '\n') {
|
} else if (char == '\n') {
|
||||||
char = 'VK_RETURN';
|
char = 'VK_RETURN';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user