SyncReturn
This commit is contained in:
parent
317b350d2b
commit
1b7eb73ee8
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -1477,7 +1477,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "flutter_rust_bridge_codegen"
|
name = "flutter_rust_bridge_codegen"
|
||||||
version = "1.32.0"
|
version = "1.32.0"
|
||||||
source = "git+https://github.com/SoLongAndThanksForAllThePizza/flutter_rust_bridge#3cc3818d19b731d5f9893c48699182bed4d4c15e"
|
source = "git+https://github.com/SoLongAndThanksForAllThePizza/flutter_rust_bridge#e5adce55eea0b74d3680e66a2c5252edf17b07e1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"cargo_metadata",
|
"cargo_metadata",
|
||||||
|
@ -600,9 +600,8 @@ class _RemotePageState extends State<RemotePage> with WindowListener {
|
|||||||
|
|
||||||
Widget getBodyForDesktopWithListener(bool keyboard) {
|
Widget getBodyForDesktopWithListener(bool keyboard) {
|
||||||
var paints = <Widget>[ImagePaint()];
|
var paints = <Widget>[ImagePaint()];
|
||||||
final cursor = FFI.bind.getSessionToggleOptionSync(
|
final cursor = FFI.bind
|
||||||
id: widget.id, arg: 'show-remote-cursor')[0] ==
|
.getSessionToggleOptionSync(id: widget.id, arg: 'show-remote-cursor');
|
||||||
1;
|
|
||||||
if (keyboard || cursor) {
|
if (keyboard || cursor) {
|
||||||
paints.add(CursorPaint());
|
paints.add(CursorPaint());
|
||||||
}
|
}
|
||||||
@ -955,7 +954,7 @@ class ImagePainter extends CustomPainter {
|
|||||||
|
|
||||||
CheckboxListTile getToggle(
|
CheckboxListTile getToggle(
|
||||||
String id, void Function(void Function()) setState, option, name) {
|
String id, void Function(void Function()) setState, option, name) {
|
||||||
final opt = FFI.bind.getSessionToggleOptionSync(id: id, arg: option)[0] == 1;
|
final opt = FFI.bind.getSessionToggleOptionSync(id: id, arg: option);
|
||||||
return CheckboxListTile(
|
return CheckboxListTile(
|
||||||
value: opt,
|
value: opt,
|
||||||
onChanged: (v) {
|
onChanged: (v) {
|
||||||
|
@ -314,7 +314,7 @@ class ImageModel with ChangeNotifier {
|
|||||||
|
|
||||||
ui.Image? get image => _image;
|
ui.Image? get image => _image;
|
||||||
|
|
||||||
String id = ""; // TODO multi image model
|
String _id = "";
|
||||||
|
|
||||||
void onRgba(Uint8List rgba) {
|
void onRgba(Uint8List rgba) {
|
||||||
if (_waitForImage) {
|
if (_waitForImage) {
|
||||||
@ -351,7 +351,7 @@ class ImageModel with ChangeNotifier {
|
|||||||
Future.delayed(Duration(milliseconds: 1), () {
|
Future.delayed(Duration(milliseconds: 1), () {
|
||||||
if (FFI.ffiModel.isPeerAndroid) {
|
if (FFI.ffiModel.isPeerAndroid) {
|
||||||
FFI.bind
|
FFI.bind
|
||||||
.sessionPeerOption(id: id, name: "view-style", value: "shrink");
|
.sessionPeerOption(id: _id, name: "view-style", value: "shrink");
|
||||||
FFI.canvasModel.updateViewStyle();
|
FFI.canvasModel.updateViewStyle();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -850,7 +850,7 @@ class FFI {
|
|||||||
// setByName('connect', id);
|
// setByName('connect', id);
|
||||||
// TODO multi model instances
|
// TODO multi model instances
|
||||||
FFI.canvasModel.id = id;
|
FFI.canvasModel.id = id;
|
||||||
FFI.imageModel.id = id;
|
FFI.imageModel._id = id;
|
||||||
FFI.cursorModel.id = id;
|
FFI.cursorModel.id = id;
|
||||||
final stream =
|
final stream =
|
||||||
FFI.bind.sessionConnect(id: id, isFileTransfer: isFileTransfer);
|
FFI.bind.sessionConnect(id: id, isFileTransfer: isFileTransfer);
|
||||||
|
@ -396,9 +396,11 @@ packages:
|
|||||||
flutter_rust_bridge:
|
flutter_rust_bridge:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: flutter_rust_bridge
|
path: frb_dart
|
||||||
url: "https://pub.dartlang.org"
|
ref: master
|
||||||
source: hosted
|
resolved-ref: e5adce55eea0b74d3680e66a2c5252edf17b07e1
|
||||||
|
url: "https://github.com/SoLongAndThanksForAllThePizza/flutter_rust_bridge"
|
||||||
|
source: git
|
||||||
version: "1.32.0"
|
version: "1.32.0"
|
||||||
flutter_smart_dialog:
|
flutter_smart_dialog:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
|
@ -53,7 +53,11 @@ dependencies:
|
|||||||
image_picker: ^0.8.5
|
image_picker: ^0.8.5
|
||||||
image: ^3.1.3
|
image: ^3.1.3
|
||||||
flutter_smart_dialog: ^4.3.1
|
flutter_smart_dialog: ^4.3.1
|
||||||
flutter_rust_bridge: ^1.30.0
|
flutter_rust_bridge:
|
||||||
|
git:
|
||||||
|
url: https://github.com/SoLongAndThanksForAllThePizza/flutter_rust_bridge
|
||||||
|
ref: master
|
||||||
|
path: frb_dart
|
||||||
window_manager: ^0.2.3
|
window_manager: ^0.2.3
|
||||||
desktop_multi_window:
|
desktop_multi_window:
|
||||||
git:
|
git:
|
||||||
|
@ -95,13 +95,9 @@ pub fn get_session_toggle_option(id: String, arg: String) -> Option<bool> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_session_toggle_option_sync(id: String, arg: String) -> SyncReturn<Vec<u8>> {
|
pub fn get_session_toggle_option_sync(id: String, arg: String) -> SyncReturn<bool> {
|
||||||
let res = if get_session_toggle_option(id, arg) == Some(true) {
|
let res = get_session_toggle_option(id, arg) == Some(true);
|
||||||
1
|
SyncReturn(res)
|
||||||
} else {
|
|
||||||
0
|
|
||||||
};
|
|
||||||
SyncReturn(vec![res])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_session_image_quality(id: String) -> Option<String> {
|
pub fn get_session_image_quality(id: String) -> Option<String> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user