reorganize
This commit is contained in:
parent
b9a2e09e74
commit
220c13a245
12 changed files with 39 additions and 29 deletions
|
|
@ -1,7 +1,8 @@
|
|||
import "dart:convert";
|
||||
import "dart:io";
|
||||
import "package:flutter/foundation.dart";
|
||||
import "package:flutter_vodozemac/flutter_vodozemac.dart";
|
||||
import "package:vodozemac/vodozemac.dart" as voz;
|
||||
import "package:flutter_vodozemac/flutter_vodozemac.dart" as voz_fl;
|
||||
import "package:matrix/matrix.dart";
|
||||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||
import "package:nexus/controllers/secure_storage_controller.dart";
|
||||
|
|
@ -14,7 +15,7 @@ class ClientController extends AsyncNotifier<Client> {
|
|||
static const sessionBackupKey = "sessionBackup";
|
||||
@override
|
||||
Future<Client> build() async {
|
||||
await init();
|
||||
if (!voz.isInitialized()) await voz_fl.init();
|
||||
final client = Client(
|
||||
"nexus",
|
||||
logLevel: kReleaseMode ? Level.warning : Level.verbose,
|
||||
|
|
@ -45,6 +46,10 @@ class ClientController extends AsyncNotifier<Client> {
|
|||
);
|
||||
}
|
||||
|
||||
ref.onDispose(
|
||||
client.onRoomState.stream.listen((_) => ref.notifyListeners()).cancel,
|
||||
);
|
||||
|
||||
return client;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue