mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-03 09:51:29 +03:00
Refact. Flutter web, mid commit (#7502)
* Refact. Flutter web, mid commit Signed-off-by: fufesou <shuanglongchen@yeah.net> * Refact. Flutter web, mid commit Signed-off-by: fufesou <shuanglongchen@yeah.net> --------- Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -690,7 +690,7 @@ class FfiModel with ChangeNotifier {
|
||||
// Because this function is asynchronous, there's an "await" in this function.
|
||||
cachedPeerData.peerInfo = {...evt};
|
||||
|
||||
// recent peer updated by handle_peer_info(ui_session_interface.rs) --> handle_peer_info(client.rs) --> save_config(client.rs)
|
||||
// Recent peer is updated by handle_peer_info(ui_session_interface.rs) --> handle_peer_info(client.rs) --> save_config(client.rs)
|
||||
bind.mainLoadRecentPeers();
|
||||
|
||||
parent.target?.dialogManager.dismissAll();
|
||||
@@ -868,7 +868,16 @@ class FfiModel with ChangeNotifier {
|
||||
|
||||
handleResolutions(String id, dynamic resolutions) {
|
||||
try {
|
||||
final List<dynamic> dynamicArray = jsonDecode(resolutions as String);
|
||||
final resolutionsObj = json.decode(resolutions as String);
|
||||
late List<dynamic> dynamicArray;
|
||||
if (resolutionsObj is Map) {
|
||||
// The web version
|
||||
dynamicArray = (resolutionsObj as Map<String, dynamic>)['resolutions']
|
||||
as List<dynamic>;
|
||||
} else {
|
||||
// The rust version
|
||||
dynamicArray = resolutionsObj as List<dynamic>;
|
||||
}
|
||||
List<Resolution> arr = List.empty(growable: true);
|
||||
for (int i = 0; i < dynamicArray.length; i++) {
|
||||
var width = dynamicArray[i]["width"];
|
||||
@@ -2236,6 +2245,10 @@ class FFI {
|
||||
}
|
||||
final stream = bind.sessionStart(sessionId: sessionId, id: id);
|
||||
if (isWeb) {
|
||||
platformFFI.setRgbaCallback((int display, Uint8List data) {
|
||||
onEvent2UIRgba();
|
||||
imageModel.onRgba(display, data);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user