From c105a6035cb810d7021562e21f0211dbb87e15cc Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Thu, 10 Sep 2026 15:21:53 -0400 Subject: [PATCH 1/2] use dot shorthands where possible in generate script --- scripts/generate.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/generate.dart b/scripts/generate.dart index 2966c9f..b9b8511 100644 --- a/scripts/generate.dart +++ b/scripts/generate.dart @@ -11,12 +11,12 @@ void main(List args) async { final libclangPath = Platform.environment["LIBCLANG_PATH"]; FfiGenerator( - output: Output( + output: .new( dart: .new( 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( entryPoints: [File(join(repoDir.path, "pkg", "ffi", "gomuksffi.h")).uri], compilerOptions: [ From 6e42902322d208887f35b11ec75a5818c00ddcec Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Thu, 10 Sep 2026 15:32:30 -0400 Subject: [PATCH 2/2] run GomuksInit on an Isolate Fixes #70 --- lib/controllers/client.dart | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/controllers/client.dart b/lib/controllers/client.dart index af44d2f..27c0646 100644 --- a/lib/controllers/client.dart +++ b/lib/controllers/client.dart @@ -49,15 +49,17 @@ import "package:path_provider/path_provider.dart"; class ClientController extends AsyncNotifier { @override Future build() async { - final Pointer root; - if (Platform.isAndroid || Platform.isIOS) { - final dir = await getApplicationSupportDirectory(); - root = "${dir.path}/gomuks".toNativeUtf8().cast(); - } else { - root = nullptr.cast(); - } + final handle = await Isolate.run(() async { + final Pointer root; + if (Platform.isAndroid || Platform.isIOS) { + final dir = await getApplicationSupportDirectory(); + root = "${dir.path}/gomuks".toNativeUtf8().cast(); + } else { + root = nullptr.cast(); + } - final handle = GomuksInit(root); + return GomuksInit(root); + }); final callable = NativeCallable<