diff --git a/flutter/lib/common/widgets/peer_tab_page.dart b/flutter/lib/common/widgets/peer_tab_page.dart index 9129e4711..523230810 100644 --- a/flutter/lib/common/widgets/peer_tab_page.dart +++ b/flutter/lib/common/widgets/peer_tab_page.dart @@ -28,14 +28,16 @@ class _PeerTabPageState extends State setPeer() { final index = bind.getLocalFlutterConfig(k: 'peer-tab-index'); - if (index == '') return; - _tabIndex.value = int.parse(index); + if (index != '') { + _tabIndex.value = int.parse(index); + } final uiType = bind.getLocalFlutterConfig(k: 'peer-card-ui-type'); - if (uiType == '') return; - peerCardUiType.value = int.parse(uiType) == PeerUiType.list.index - ? PeerUiType.list - : PeerUiType.grid; + if (uiType != '') { + peerCardUiType.value = int.parse(uiType) == PeerUiType.list.index + ? PeerUiType.list + : PeerUiType.grid; + } } // hard code for now diff --git a/flutter/lib/desktop/pages/remote_page.dart b/flutter/lib/desktop/pages/remote_page.dart index 117a0ab02..1aca198c2 100644 --- a/flutter/lib/desktop/pages/remote_page.dart +++ b/flutter/lib/desktop/pages/remote_page.dart @@ -321,12 +321,10 @@ class _ImagePaintState extends State { if (c.scrollStyle == ScrollStyle.scrollbar) { final imageWidth = c.getDisplayWidth() * s; final imageHeight = c.getDisplayHeight() * s; - final imageWidget = SizedBox( - width: imageWidth, - height: imageHeight, - child: CustomPaint( - painter: ImagePainter(image: m.image, x: 0, y: 0, scale: s), - )); + final imageWidget = CustomPaint( + size: Size(imageWidth, imageHeight), + painter: ImagePainter(image: m.image, x: 0, y: 0, scale: s), + ); return NotificationListener( onNotification: (notification) { @@ -350,13 +348,10 @@ class _ImagePaintState extends State { Size(imageWidth, imageHeight))), ); } else { - final imageWidget = SizedBox( - width: c.size.width, - height: c.size.height, - child: CustomPaint( - painter: - ImagePainter(image: m.image, x: c.x / s, y: c.y / s, scale: s), - )); + final imageWidget = CustomPaint( + size: Size(c.size.width, c.size.height), + painter: ImagePainter(image: m.image, x: c.x / s, y: c.y / s, scale: s), + ); return mouseRegion(child: _buildListener(imageWidget)); } }