wip thing

This commit is contained in:
Henry Hiles 2026-01-29 11:52:56 +00:00
commit 0df327d125
No known key found for this signature in database
21 changed files with 236 additions and 121 deletions

View file

@ -1,3 +1,5 @@
import "dart:ffi";
import "dart:isolate";
import "package:ffi/ffi.dart";
import "package:flutter_riverpod/flutter_riverpod.dart";
import "package:nexus/controllers/client_controller.dart";
@ -7,13 +9,14 @@ class HeaderController extends AsyncNotifier<Map<String, String>> {
@override
Future<Map<String, String>> build() async {
final handle = await ref.watch(ClientController.provider.future);
final info = GomuksGetAccountInfo(handle);
final info = await Isolate.run(() => GomuksGetAccountInfo(handle));
final headers = {
"authorization":
"Bearer ${info.access_token.cast<Utf8>().toDartString()}",
if (info.access_token != nullptr)
"authorization":
"Bearer ${info.access_token.cast<Utf8>().toDartString()}",
};
GomuksFreeAccountInfo(info);
await Isolate.run(() => GomuksFreeAccountInfo(info));
return headers;
}