From 9fbd16fb0acf40d12f47b515dbd85bb4aead435e Mon Sep 17 00:00:00 2001 From: Michael-F-Bryan Date: Mon, 25 Oct 2021 15:10:25 +0800 Subject: [PATCH] Regenerate the bindings --- .gitignore | 1 + ios/Classes/bridge_generated.h | 1 - lib/bridge_generated.dart | 12 ++++++++---- pubspec.yaml | 2 +- rust/Cargo.toml | 5 ++++- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index e9dc58d..21d6006 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ .pub/ build/ +*.so diff --git a/ios/Classes/bridge_generated.h b/ios/Classes/bridge_generated.h index d435414..4f64373 100644 --- a/ios/Classes/bridge_generated.h +++ b/ios/Classes/bridge_generated.h @@ -1,4 +1,3 @@ -#include #include #include #include diff --git a/lib/bridge_generated.dart b/lib/bridge_generated.dart index 0b7c98d..3ec458c 100644 --- a/lib/bridge_generated.dart +++ b/lib/bridge_generated.dart @@ -129,7 +129,7 @@ class NativeAddWire implements FlutterRustBridgeWireBase { .asFunction Function(int)>(); void store_dart_post_cobject( - int ptr, + DartPostCObjectFnType ptr, ) { return _store_dart_post_cobject( ptr, @@ -137,10 +137,10 @@ class NativeAddWire implements FlutterRustBridgeWireBase { } late final _store_dart_post_cobjectPtr = - _lookup>( + _lookup>( 'store_dart_post_cobject'); - late final _store_dart_post_cobject = - _store_dart_post_cobjectPtr.asFunction(); + late final _store_dart_post_cobject = _store_dart_post_cobjectPtr + .asFunction(); } class wire_uint_8_list extends ffi.Struct { @@ -149,3 +149,7 @@ class wire_uint_8_list extends ffi.Struct { @ffi.Int32() external int len; } + +typedef DartPostCObjectFnType = ffi.Pointer< + ffi.NativeFunction)>>; +typedef DartPort = ffi.Int64; diff --git a/pubspec.yaml b/pubspec.yaml index cc92642..4d22820 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.0.1 homepage: environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.14.0 <3.0.0" flutter: ">=1.20.0" dependencies: diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 6c485ac..34ed507 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -7,4 +7,7 @@ edition = "2021" [dependencies] anyhow = "1.0.44" -flutter_rust_bridge = "1.2.0" +flutter_rust_bridge = { git = "https://github.com/fzyzcjy/flutter_rust_bridge", branch = "master" } + +[lib] +crate-type = ["staticlib", "cdylib"]