mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-13 03:51:27 +03:00
fix chat model
This commit is contained in:
@@ -21,10 +21,9 @@ class ChatPage extends StatelessWidget implements PageShape {
|
||||
icon: Icon(Icons.group),
|
||||
itemBuilder: (context) {
|
||||
final chatModel = FFI.chatModel;
|
||||
final serverModel = FFI.serverModel;
|
||||
return chatModel.messages.entries.map((entry) {
|
||||
final id = entry.key;
|
||||
final user = serverModel.clients[id]?.chatUser ?? chatModel.me;
|
||||
final user = entry.value.chatUser;
|
||||
return PopupMenuItem<int>(
|
||||
child: Text("${user.name} ${user.uid}"),
|
||||
value: id,
|
||||
@@ -54,7 +53,9 @@ class ChatPage extends StatelessWidget implements PageShape {
|
||||
chatModel.send(chatMsg);
|
||||
},
|
||||
user: chatModel.me,
|
||||
messages: chatModel.messages[chatModel.currentID] ?? [],
|
||||
messages:
|
||||
chatModel.messages[chatModel.currentID]?.chatMessages ??
|
||||
[],
|
||||
// default scrollToBottom has bug https://github.com/fayeed/dash_chat/issues/53
|
||||
scrollToBottom: false,
|
||||
scrollController: chatModel.scroller,
|
||||
|
||||
@@ -91,7 +91,9 @@ class _RemotePageState extends State<RemotePage> {
|
||||
if (v < 100) {
|
||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
|
||||
overlays: []);
|
||||
if (chatWindowOverlayEntry == null) {
|
||||
// [pi.version.isNotEmpty] -> check ready or not,avoid login without soft-keyboard
|
||||
if (chatWindowOverlayEntry == null &&
|
||||
FFI.ffiModel.pi.version.isNotEmpty) {
|
||||
FFI.invokeMethod("enable_soft_keyboard", false);
|
||||
}
|
||||
}
|
||||
@@ -397,33 +399,33 @@ class _RemotePageState extends State<RemotePage> {
|
||||
] +
|
||||
(isDesktop
|
||||
? []
|
||||
: [
|
||||
IconButton(
|
||||
color: Colors.white,
|
||||
icon: Icon(Icons.keyboard),
|
||||
onPressed: openKeyboard),
|
||||
FFI.ffiModel.isPeerAndroid
|
||||
? (keyboard
|
||||
? IconButton(
|
||||
color: Colors.white,
|
||||
icon: Icon(Icons.build),
|
||||
onPressed: () {
|
||||
if (mobileActionsOverlayEntry == null) {
|
||||
showMobileActionsOverlay();
|
||||
} else {
|
||||
hideMobileActionsOverlay();
|
||||
}
|
||||
},
|
||||
)
|
||||
: SizedBox.shrink())
|
||||
: IconButton(
|
||||
: FFI.ffiModel.isPeerAndroid
|
||||
? [
|
||||
IconButton(
|
||||
color: Colors.white,
|
||||
icon: Icon(Icons.build),
|
||||
onPressed: () {
|
||||
if (mobileActionsOverlayEntry == null) {
|
||||
showMobileActionsOverlay();
|
||||
} else {
|
||||
hideMobileActionsOverlay();
|
||||
}
|
||||
},
|
||||
)
|
||||
]
|
||||
: [
|
||||
IconButton(
|
||||
color: Colors.white,
|
||||
icon: Icon(FFI.ffiModel.touchMode
|
||||
? Icons.touch_app
|
||||
: Icons.mouse),
|
||||
onPressed: changeTouchMode,
|
||||
)
|
||||
]) +
|
||||
icon: Icon(Icons.keyboard),
|
||||
onPressed: openKeyboard),
|
||||
IconButton(
|
||||
color: Colors.white,
|
||||
icon: Icon(FFI.ffiModel.touchMode
|
||||
? Icons.touch_app
|
||||
: Icons.mouse),
|
||||
onPressed: changeTouchMode,
|
||||
),
|
||||
]) +
|
||||
(isWeb
|
||||
? []
|
||||
: <Widget>[
|
||||
|
||||
Reference in New Issue
Block a user