const sessionId for mobile

This commit is contained in:
rustdesk 2023-06-09 19:57:37 +08:00
parent 024c181d69
commit 501323ff6a
3 changed files with 3 additions and 5 deletions

View File

@ -2,7 +2,6 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_breadcrumb/flutter_breadcrumb.dart';
import 'package:flutter_hbb/consts.dart';
import 'package:flutter_hbb/models/file_model.dart';
import 'package:get/get.dart';
import 'package:toggle_switch/toggle_switch.dart';

View File

@ -1,5 +1,4 @@
import 'dart:async';
import 'dart:convert';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
@ -11,7 +10,6 @@ import 'package:flutter_hbb/mobile/widgets/gesture_help.dart';
import 'package:flutter_hbb/models/chat_model.dart';
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
import 'package:get/get.dart';
import 'package:get/get_state_manager/src/rx_flutter/rx_obx_widget.dart';
import 'package:provider/provider.dart';
import 'package:wakelock/wakelock.dart';

View File

@ -2,7 +2,6 @@ import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'dart:math';
import 'dart:typed_data';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
@ -39,6 +38,7 @@ import 'platform_model.dart';
typedef HandleMsgBox = Function(Map<String, dynamic> evt, String id);
typedef ReconnectHandle = Function(OverlayDialogManager, SessionID, bool);
final _waitForImage = <UuidValue, bool>{};
final _constSessionId = Uuid().v4obj();
class FfiModel with ChangeNotifier {
PeerInfo _pi = PeerInfo();
@ -1580,7 +1580,6 @@ enum ConnType { defaultConn, fileTransfer, portForward, rdp }
/// Flutter state manager and data communication with the Rust core.
class FFI {
final sessionId = Uuid().v4obj();
var id = '';
var version = '';
var connType = ConnType.defaultConn;
@ -1589,6 +1588,7 @@ class FFI {
/// dialogManager use late to ensure init after main page binding [globalKey]
late final dialogManager = OverlayDialogManager();
late final SessionID sessionId;
late final ImageModel imageModel; // session
late final FfiModel ffiModel; // session
late final CursorModel cursorModel; // session
@ -1606,6 +1606,7 @@ class FFI {
late final ElevationModel elevationModel; // session
FFI() {
sessionId = isDesktop ? Uuid().v4obj() : _constSessionId;
imageModel = ImageModel(WeakReference(this));
ffiModel = FfiModel(WeakReference(this));
cursorModel = CursorModel(WeakReference(this));