add login flow
This commit is contained in:
parent
ec40e76178
commit
f307fad074
3 changed files with 84 additions and 64 deletions
|
|
@ -1,19 +0,0 @@
|
|||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||
import "package:nexus/controllers/client_controller.dart";
|
||||
|
||||
class LoginHelper {
|
||||
final Ref ref;
|
||||
LoginHelper(this.ref);
|
||||
|
||||
Future<bool> setHomeserver(Uri homeserverUrl) async {
|
||||
final client = await ref.watch(ClientController.provider.future);
|
||||
try {
|
||||
await client.checkHomeserver(homeserverUrl);
|
||||
return true;
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static final provider = Provider<LoginHelper>(LoginHelper.new);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue