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,15 +49,17 @@ import "package:path_provider/path_provider.dart";
class ClientController extends AsyncNotifier<int> {
@override
Future<int> build() async {
final Pointer<Char> 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<Char> 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<

View file

@ -11,12 +11,12 @@ void main(List<String> 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: [