plugin_framework, show remote toolbar widget

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-04-23 20:53:51 +08:00
parent eb96b0d451
commit cbeebea7a5
10 changed files with 86 additions and 49 deletions

View File

@@ -123,6 +123,7 @@ class _RemotePageState extends State<RemotePage>
});
}
_ffi.ffiModel.updateEventListener(widget.id);
bind.pluginSyncUi(syncTo: kAppTypeDesktopRemote);
_ffi.qualityMonitorModel.checkShowQualityMonitor(widget.id);
// Session option should be set after models.dart/FFI.start
_showRemoteCursor.value = bind.sessionGetToggleOptionSync(

View File

@@ -124,6 +124,7 @@ void runMainApp(bool startService) async {
if (startService) {
// await windowManager.ensureInitialized();
gFFI.serverModel.startService();
bind.pluginSyncUi(syncTo: kAppTypeMain);
}
gFFI.userModel.refreshCurrentUser();
runApp(App());

View File

@@ -2,6 +2,7 @@ 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

@@ -341,7 +341,6 @@ class ServerModel with ChangeNotifier {
_isStart = true;
notifyListeners();
parent.target?.ffiModel.updateEventListener("");
bind.pluginSyncUi();
await parent.target?.invokeMethod("init_service");
// ugly is here, because for desktop, below is useless
await bind.mainStartService();

View File

@@ -1,3 +1,5 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_hbb/models/model.dart';
@@ -198,7 +200,14 @@ void handleReloading(Map<String, dynamic> evt, String peer) {
if (evt['id'] == null || evt['location'] == null) {
return;
}
addLocationUi(evt['location']!, evt['id']!, UiType.fromJson(evt));
try {
final ui = UiType.create(json.decode(evt['ui'] as String));
if (ui != null) {
addLocationUi(evt['location']!, evt['id']!, ui);
}
} catch (e) {
debugPrint('Failed handleReloading, json decode of ui, $e ');
}
}
void handleOption(Map<String, dynamic> evt, String peer) {