fix: IME awayls float

This commit is contained in:
Junyuan Feng
2022-12-04 15:52:41 +08:00
parent 9541c0c7ab
commit 3998f549e4
5 changed files with 54 additions and 44 deletions

View File

@@ -63,6 +63,7 @@ class _ConvertPageState extends State<ConvertPage>
}
},
tooltip: s.convert,
heroTag: 'convert fab',
child: const Icon(Icons.send),
),
);

View File

@@ -87,15 +87,16 @@ class _MyHomePageState extends State<MyHomePage>
Widget build(BuildContext context) {
super.build(context);
return WillPopScope(
child: _buildMain(context),
onWillPop: () {
final scaffold = Scaffold.of(context);
if (scaffold.isDrawerOpen) {
scaffold.closeDrawer();
return Future.value(false);
}
return Future.value(true);
});
child: _buildMain(context),
onWillPop: () {
final scaffold = Scaffold.of(context);
if (scaffold.isDrawerOpen) {
scaffold.closeDrawer();
return Future.value(false);
}
return Future.value(true);
},
);
}
Widget _buildMain(BuildContext context) {
@@ -116,7 +117,7 @@ class _MyHomePageState extends State<MyHomePage>
physics: const ClampingScrollPhysics(),
controller: _pageController,
onPageChanged: (i) {
FocusScope.of(context).unfocus();
FocusScope.of(context).requestFocus(FocusNode());
_selectIndex = i;
setState(() {});
},

View File

@@ -71,7 +71,7 @@ class _PingPageState extends State<PingPage>
),
])),
floatingActionButton: FloatingActionButton(
child: const Icon(Icons.play_arrow),
heroTag: 'ping fab',
onPressed: () {
try {
doPing();
@@ -79,6 +79,7 @@ class _PingPageState extends State<PingPage>
showSnackBar(context, Text('Error: \n$e'));
}
},
child: const Icon(Icons.play_arrow),
),
);
}