forked from Henry-Hiles/nexus
wip thing
This commit is contained in:
parent
715bb15738
commit
92eedc92ab
21 changed files with 236 additions and 121 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue