diff --git a/flutter/lib/mobile/pages/remote_page.dart b/flutter/lib/mobile/pages/remote_page.dart index 74a5af45c..4cd3f842a 100644 --- a/flutter/lib/mobile/pages/remote_page.dart +++ b/flutter/lib/mobile/pages/remote_page.dart @@ -342,11 +342,15 @@ class _RemotePageState extends State with WidgetsBindingObserver { }); } - Widget _bottomWidget() => _showGestureHelp - ? getGestureHelp() - : (_showBar && gFFI.ffiModel.pi.displays.isNotEmpty - ? getBottomAppBar() - : Offstage()); + Widget _bottomWidget() => AnimatedSize( + duration: const Duration(milliseconds: 200), + curve: Curves.easeOutCubic, + child: _showGestureHelp + ? getGestureHelp() + : (_showBar && gFFI.ffiModel.pi.displays.isNotEmpty + ? getBottomAppBar() + : const SizedBox(width: double.infinity, height: 0)), + ); @override Widget build(BuildContext context) { @@ -360,6 +364,7 @@ class _RemotePageState extends State with WidgetsBindingObserver { return false; }, child: Scaffold( + extendBody: true, // workaround for https://github.com/rustdesk/rustdesk/issues/3131 floatingActionButtonLocation: keyboardIsVisible ? FABLocation(FloatingActionButtonLocation.endFloat, 0, -35) @@ -389,24 +394,11 @@ class _RemotePageState extends State with WidgetsBindingObserver { } }); }), - bottomNavigationBar: Obx(() => Stack( - alignment: Alignment.bottomCenter, - children: [ - gFFI.ffiModel.pi.isSet.isTrue && - gFFI.ffiModel.waitForFirstImage.isTrue - ? emptyOverlay(MyTheme.canvasColor) - : () { - gFFI.ffiModel.tryShowAndroidActionsOverlay(); - return Offstage(); - }(), - _bottomWidget(), - gFFI.ffiModel.pi.isSet.isFalse - ? emptyOverlay(MyTheme.canvasColor) - : Offstage(), - ], - )), body: Obx( - () => getRawPointerAndKeyBody(Overlay( + () => Stack( + alignment: Alignment.bottomCenter, + children: [ + getRawPointerAndKeyBody(Overlay( initialEntries: [ OverlayEntry(builder: (context) { return Container( @@ -437,7 +429,20 @@ class _RemotePageState extends State with WidgetsBindingObserver { }) ], )), - )), + gFFI.ffiModel.pi.isSet.isTrue && + gFFI.ffiModel.waitForFirstImage.isTrue + ? emptyOverlay(MyTheme.canvasColor) + : () { + gFFI.ffiModel.tryShowAndroidActionsOverlay(); + return Offstage(); + }(), + _bottomWidget(), + gFFI.ffiModel.pi.isSet.isFalse + ? emptyOverlay(MyTheme.canvasColor) + : Offstage(), + ], + ), + )), ); } @@ -462,7 +467,9 @@ class _RemotePageState extends State with WidgetsBindingObserver { return BottomAppBar( elevation: 10, color: MyTheme.accent, - child: Row( + child: Padding( + padding: const EdgeInsets.only(bottom: 5.0, left: 16.0, right: 16.0), + child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -553,6 +560,7 @@ class _RemotePageState extends State with WidgetsBindingObserver { )), ], ), + ), ); } @@ -787,8 +795,10 @@ class _RemotePageState extends State with WidgetsBindingObserver { /// aka changeTouchMode BottomAppBar getGestureHelp() { return BottomAppBar( - child: SingleChildScrollView( - controller: ScrollController(), + child: Padding( + padding: const EdgeInsets.only(bottom: 5.0, left: 16.0, right: 16.0), + child: SingleChildScrollView( + controller: ScrollController(), padding: EdgeInsets.symmetric(vertical: 10), child: GestureHelp( touchMode: gFFI.ffiModel.touchMode, @@ -799,7 +809,7 @@ class _RemotePageState extends State with WidgetsBindingObserver { }, virtualMouseMode: gFFI.ffiModel.virtualMouseMode, inputModel: gFFI.inputModel, - ))); + )))); } // * Currently mobile does not enable map mode