implemented user backups

This commit is contained in:
Fabian Freund
2025-12-18 18:38:06 +01:00
parent 2f1ecd50e1
commit 018915298a
19 changed files with 1172 additions and 78 deletions
+43
View File
@@ -73,6 +73,18 @@ part of 'routes.dart';
path: 'profiles',
routes: [
TypedGoRoute<EditProfileRoute>(name: 'ProfileEditScreen', path: 'edit'),
TypedGoRoute<ProfileBackupListRoute>(
name: 'ProfileBackupListRoute',
path: 'backup_list',
),
TypedGoRoute<RestoreProfileRoute>(
name: 'RestoreProfileRoute',
path: 'restore',
),
TypedGoRoute<BackupProfileRoute>(
name: 'BackupProfileRoute',
path: 'backup',
),
TypedGoRoute<CreateProfileRoute>(
name: 'CreateProfileRoute',
path: 'create',
@@ -303,6 +315,37 @@ class EditProfileRoute extends GoRouteData with $EditProfileRoute {
}
}
class BackupProfileRoute extends GoRouteData with $BackupProfileRoute {
final String profile;
const BackupProfileRoute({required this.profile});
@override
Widget build(BuildContext context, GoRouterState state) {
return ProfileBackupScreen(
profile: Profile.fromJson(jsonDecode(profile) as Map<String, dynamic>),
);
}
}
class RestoreProfileRoute extends GoRouteData with $RestoreProfileRoute {
final String backupFilePath;
const RestoreProfileRoute({required this.backupFilePath});
@override
Widget build(BuildContext context, GoRouterState state) {
return ProfileRestoreScreen(backupFile: File(backupFilePath));
}
}
class ProfileBackupListRoute extends GoRouteData with $ProfileBackupListRoute {
@override
Widget build(BuildContext context, GoRouterState state) {
return const ProfileBackupListScreen();
}
}
class BookmarkListRoute extends GoRouteData with $BookmarkListRoute {
final String entryGuid;