mobile handle orientation change

This commit is contained in:
csf
2022-06-02 17:16:23 +08:00
parent cd78f76aff
commit 37339805c2
3 changed files with 26 additions and 3 deletions

View File

@@ -33,6 +33,7 @@ class _RemotePageState extends State<RemotePage> {
String _value = '';
double _scale = 1;
double _mouseScrollIntegral = 0; // mouse scroll speed controller
Orientation? _currentOrientation;
var _more = true;
var _fn = false;
@@ -258,12 +259,22 @@ class _RemotePageState extends State<RemotePage> {
color: Colors.black,
child: isDesktop
? getBodyForDesktopWithListener(keyboard)
: SafeArea(
child: Container(
: SafeArea(child:
OrientationBuilder(builder: (ctx, orientation) {
if (_currentOrientation != orientation) {
debugPrint("on orientation changed");
Timer(Duration(milliseconds: 200), () {
resetMobileActionsOverlay();
_currentOrientation = orientation;
FFI.canvasModel.updateViewStyle();
});
}
return Container(
color: MyTheme.canvasColor,
child: _isPhysicalMouse
? getBodyForMobile()
: getBodyForMobileWithGesture())));
: getBodyForMobileWithGesture());
})));
})
],
))),