mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 02:57:22 +00:00
refactor all [setByName] [getByName] to async bridge function
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:dash_chat_2/dash_chat_2.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hbb/models/platform_model.dart';
|
||||
@@ -106,12 +104,11 @@ class ChatModel with ChangeNotifier {
|
||||
if (message.text.isNotEmpty) {
|
||||
_messages[_currentID]?.insert(message);
|
||||
if (_currentID == clientModeID) {
|
||||
_ffi.target?.setByName("chat_client_mode", message.text);
|
||||
if (_ffi.target != null) {
|
||||
bind.sessionSendChat(id: _ffi.target!.id, text: message.text);
|
||||
}
|
||||
} else {
|
||||
final msg = Map()
|
||||
..["id"] = _currentID
|
||||
..["text"] = message.text;
|
||||
_ffi.target?.setByName("chat_server_mode", jsonEncode(msg));
|
||||
bind.serverSendChat(connId: _currentID, msg: message.text);
|
||||
}
|
||||
}
|
||||
notifyListeners();
|
||||
|
||||
Reference in New Issue
Block a user