url launch support
This commit is contained in:
parent
40bad1e06e
commit
dca9ee1939
3 changed files with 56 additions and 28 deletions
|
|
@ -1,33 +1,33 @@
|
|||
import "dart:io";
|
||||
// import "dart:io";
|
||||
|
||||
import "package:matrix/matrix.dart";
|
||||
import "package:nexusbot/controllers/settings_controller.dart";
|
||||
import "package:riverpod/riverpod.dart";
|
||||
import "package:sqflite_common_ffi/sqflite_ffi.dart";
|
||||
// import "package:matrix/matrix.dart";
|
||||
// import "package:nexusbot/controllers/settings_controller.dart";
|
||||
// import "package:riverpod/riverpod.dart";
|
||||
// import "package:sqflite_common_ffi/sqflite_ffi.dart";
|
||||
|
||||
class ClientController extends AsyncNotifier<Client> {
|
||||
@override
|
||||
Future<Client> build() async {
|
||||
final settings = ref.watch(SettingsController.provider)!;
|
||||
final client = Client(
|
||||
"nexusbot",
|
||||
database: await MatrixSdkDatabase.init(
|
||||
"NexusBot",
|
||||
database: await databaseFactoryFfi.openDatabase(inMemoryDatabasePath),
|
||||
),
|
||||
);
|
||||
// class ClientController extends AsyncNotifier<Client> {
|
||||
// @override
|
||||
// Future<Client> build() async {
|
||||
// final settings = ref.watch(SettingsController.provider)!;
|
||||
// final client = Client(
|
||||
// "nexusbot",
|
||||
// database: await MatrixSdkDatabase.init(
|
||||
// "NexusBot",
|
||||
// database: await databaseFactoryFfi.openDatabase(inMemoryDatabasePath),
|
||||
// ),
|
||||
// );
|
||||
|
||||
await client.checkHomeserver(settings.homeserver);
|
||||
await client.login(
|
||||
LoginType.mLoginPassword,
|
||||
identifier: AuthenticationUserIdentifier(user: settings.name),
|
||||
password: (await File(settings.botPasswordFile).readAsString()).trim(),
|
||||
);
|
||||
// await client.checkHomeserver(settings.homeserver);
|
||||
// await client.login(
|
||||
// LoginType.mLoginPassword,
|
||||
// identifier: AuthenticationUserIdentifier(user: settings.name),
|
||||
// password: (await File(settings.botPasswordFile).readAsString()).trim(),
|
||||
// );
|
||||
|
||||
return client;
|
||||
}
|
||||
// return client;
|
||||
// }
|
||||
|
||||
static final provider = AsyncNotifierProvider<ClientController, Client>(
|
||||
ClientController.new,
|
||||
);
|
||||
}
|
||||
// static final provider = AsyncNotifierProvider<ClientController, Client>(
|
||||
// ClientController.new,
|
||||
// );
|
||||
// }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue