feat: Implement new sign in flow
This commit is contained in:
parent
f7932639e2
commit
4d7f0295ca
19 changed files with 944 additions and 559 deletions
21
lib/pages/intro/flows/restore_backup_flow.dart
Normal file
21
lib/pages/intro/flows/restore_backup_flow.dart
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:fluffychat/utils/file_selector.dart';
|
||||
import 'package:fluffychat/widgets/future_loading_dialog.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
|
||||
Future<void> restoreBackupFlow(BuildContext context) async {
|
||||
final picked = await selectFiles(context);
|
||||
final file = picked.firstOrNull;
|
||||
if (file == null) return;
|
||||
|
||||
if (!context.mounted) return;
|
||||
await showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: () async {
|
||||
final client = await Matrix.of(context).getLoginClient();
|
||||
await client.importDump(String.fromCharCodes(await file.readAsBytes()));
|
||||
Matrix.of(context).initMatrix();
|
||||
},
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue