From 4f4498666e78cc413d46123caf2a6bf4149d581e Mon Sep 17 00:00:00 2001 From: dignow Date: Mon, 16 Oct 2023 23:19:07 +0800 Subject: [PATCH] fix, remove warns, misspellings Signed-off-by: dignow --- flutter/lib/models/chat_model.dart | 10 +++++----- flutter/lib/models/model.dart | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/flutter/lib/models/chat_model.dart b/flutter/lib/models/chat_model.dart index 77eeb3a7e..93cdbbed5 100644 --- a/flutter/lib/models/chat_model.dart +++ b/flutter/lib/models/chat_model.dart @@ -103,7 +103,7 @@ class ChatModel with ChangeNotifier { void setOverlayState(BlockableOverlayState blockableOverlayState) { _blockableOverlayState = blockableOverlayState; - _blockableOverlayState!.addMiddleBlockedListener((v) { + _blockableOverlayState.addMiddleBlockedListener((v) { if (!v) { isWindowFocus.value = false; if (isWindowFocus.value) { @@ -197,9 +197,9 @@ class ChatModel with ChangeNotifier { showChatWindowOverlay({Offset? chatInitPos}) { if (chatWindowOverlayEntry != null) return; isWindowFocus.value = true; - _blockableOverlayState?.setMiddleBlocked(true); + _blockableOverlayState.setMiddleBlocked(true); - final overlayState = _blockableOverlayState?.state; + final overlayState = _blockableOverlayState.state; if (overlayState == null) return; if (isMobile && !gFFI.chatModel.currentKey.isOut && // not in remote page @@ -212,7 +212,7 @@ class ChatModel with ChangeNotifier { onPointerDown: (_) { if (!isWindowFocus.value) { isWindowFocus.value = true; - _blockableOverlayState?.setMiddleBlocked(true); + _blockableOverlayState.setMiddleBlocked(true); } }, child: DraggableChatWindow( @@ -228,7 +228,7 @@ class ChatModel with ChangeNotifier { hideChatWindowOverlay() { if (chatWindowOverlayEntry != null) { - _blockableOverlayState?.setMiddleBlocked(false); + _blockableOverlayState.setMiddleBlocked(false); chatWindowOverlayEntry!.remove(); chatWindowOverlayEntry = null; return; diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index d257f3290..56e18d309 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -689,12 +689,12 @@ class FfiModel with ChangeNotifier { sessionId: sessionId, arg: 'view-only')); } if (connType == ConnType.defaultConn) { - final platformDdditions = evt['platform_additions']; - if (platformDdditions != null && platformDdditions != '') { + final platformAdditions = evt['platform_additions']; + if (platformAdditions != null && platformAdditions != '') { try { - _pi.platformDdditions = json.decode(platformDdditions); + _pi.platformAdditions = json.decode(platformAdditions); } catch (e) { - debugPrint('Failed to decode platformDdditions $e'); + debugPrint('Failed to decode platformAdditions $e'); } } } @@ -2203,13 +2203,13 @@ class PeerInfo with ChangeNotifier { List displays = []; Features features = Features(); List resolutions = []; - Map platformDdditions = {}; + Map platformAdditions = {}; RxInt displaysCount = 0.obs; RxBool isSet = false.obs; - bool get isWayland => platformDdditions['is_wayland'] == true; - bool get isHeadless => platformDdditions['headless'] == true; + bool get isWayland => platformAdditions['is_wayland'] == true; + bool get isHeadless => platformAdditions['headless'] == true; bool get isSupportMultiDisplay => isDesktop && isSupportMultiUiSession;