Compare commits

..
Author SHA1 Message Date
6e42902322
run GomuksInit on an Isolate
Fixes #70
2026-09-10 15:32:30 -04:00
c105a6035c
use dot shorthands where possible in generate script 2026-09-10 15:21:53 -04:00
2 changed files with 13 additions and 11 deletions

View file

@ -49,6 +49,7 @@ import "package:path_provider/path_provider.dart";
class ClientController extends AsyncNotifier<int> { class ClientController extends AsyncNotifier<int> {
@override @override
Future<int> build() async { Future<int> build() async {
final handle = await Isolate.run(() async {
final Pointer<Char> root; final Pointer<Char> root;
if (Platform.isAndroid || Platform.isIOS) { if (Platform.isAndroid || Platform.isIOS) {
final dir = await getApplicationSupportDirectory(); final dir = await getApplicationSupportDirectory();
@ -57,7 +58,8 @@ class ClientController extends AsyncNotifier<int> {
root = nullptr.cast(); root = nullptr.cast();
} }
final handle = GomuksInit(root); return GomuksInit(root);
});
final callable = final callable =
NativeCallable< NativeCallable<

View file

@ -11,12 +11,12 @@ void main(List<String> args) async {
final libclangPath = Platform.environment["LIBCLANG_PATH"]; final libclangPath = Platform.environment["LIBCLANG_PATH"];
FfiGenerator( FfiGenerator(
output: Output( output: .new(
dart: .new( dart: .new(
path: Platform.script.resolve("../lib/src/third_party/gomuks.g.dart"), path: Platform.script.resolve("../lib/src/third_party/gomuks.g.dart"),
), ),
), ),
visitors: [Visitor(func: (node) => node.isIncluded = true)], visitors: [.new(func: (node) => node.isIncluded = true)],
input: .new( input: .new(
entryPoints: [File(join(repoDir.path, "pkg", "ffi", "gomuksffi.h")).uri], entryPoints: [File(join(repoDir.path, "pkg", "ffi", "gomuksffi.h")).uri],
compilerOptions: [ compilerOptions: [