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