fix msgbox hasCancel and home id editor focus problem

This commit is contained in:
open-trade
2020-11-24 11:25:56 +08:00
parent 23f1ce5da5
commit 982df980bd
4 changed files with 38 additions and 8 deletions

View File

@@ -48,6 +48,10 @@ class _HomePageState extends State<HomePage> {
builder: (BuildContext context) => RemotePage(id: id),
),
);
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
}
Widget getSearchBarUI() {
@@ -98,7 +102,7 @@ class _HomePageState extends State<HomePage> {
color: Color(0xFFB9BABC),
),
),
autofocus: false,
autofocus: _idController.text.isEmpty,
controller: _idController,
),
),
@@ -110,6 +114,7 @@ class _HomePageState extends State<HomePage> {
icon: Icon(Icons.arrow_forward,
color: Color(0xFFB9BABC), size: 45),
onPressed: onConnect,
autofocus: _idController.text.isNotEmpty,
),
)
],