fix keyboard show/hide/show/hide for the first time click on keyboard
button after password dialog
This commit is contained in:
parent
61cbe74547
commit
af4f772b8a
@ -34,6 +34,7 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
var _more = false;
|
var _more = false;
|
||||||
var _fn = false;
|
var _fn = false;
|
||||||
final FocusNode _focusNode = FocusNode();
|
final FocusNode _focusNode = FocusNode();
|
||||||
|
var _showEdit = true;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -130,11 +131,20 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
icon: Icon(Icons.keyboard),
|
icon: Icon(Icons.keyboard),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
SystemChrome.setEnabledSystemUIOverlays(
|
// destroy first, so that our _value trick can work
|
||||||
SystemUiOverlay.values);
|
setState(() => _showEdit = false);
|
||||||
_focusNode.requestFocus();
|
Timer(Duration(milliseconds: 30), () {
|
||||||
SystemChannels.textInput
|
// show now, and sleep a while to requestFocus to
|
||||||
.invokeMethod('TextInput.show');
|
// make sure edit ready, so that keyboard wont show/hide/show/hide happen
|
||||||
|
setState(() => _showEdit = true);
|
||||||
|
Timer(Duration(milliseconds: 30), () {
|
||||||
|
SystemChrome.setEnabledSystemUIOverlays(
|
||||||
|
SystemUiOverlay.values);
|
||||||
|
_focusNode.requestFocus();
|
||||||
|
SystemChannels.textInput
|
||||||
|
.invokeMethod('TextInput.show');
|
||||||
|
});
|
||||||
|
});
|
||||||
}),
|
}),
|
||||||
IconButton(
|
IconButton(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
@ -231,7 +241,7 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
width: 0,
|
width: 0,
|
||||||
height: 0,
|
height: 0,
|
||||||
child: _bottom < 100
|
child: !_showEdit
|
||||||
? Container()
|
? Container()
|
||||||
: TextFormField(
|
: TextFormField(
|
||||||
textInputAction: TextInputAction.newline,
|
textInputAction: TextInputAction.newline,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user