reorganize routes
This commit is contained in:
@@ -27,8 +27,6 @@ part of 'routes.dart';
|
||||
name: 'SearchRoute',
|
||||
path: 'search/:tabType/:searchText',
|
||||
),
|
||||
TypedGoRoute<TorProxyRoute>(name: 'TorProxyRoute', path: 'tor_proxy'),
|
||||
TypedGoRoute<HistoryRoute>(name: 'HistoryRoute', path: 'history'),
|
||||
TypedGoRoute<TabViewRoute>(name: 'TabViewRoute', path: 'tab_view'),
|
||||
TypedGoRoute<ContextMenuRoute>(
|
||||
name: 'ContextMenuRoute',
|
||||
@@ -68,49 +66,6 @@ part of 'routes.dart';
|
||||
name: 'SelectProfileRoute',
|
||||
path: 'profile',
|
||||
),
|
||||
TypedGoRoute<ProfileListRoute>(
|
||||
name: 'ProfileListRoute',
|
||||
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',
|
||||
),
|
||||
],
|
||||
),
|
||||
TypedGoRoute<BookmarkListRoute>(
|
||||
name: 'BookmarkListRoute',
|
||||
path: 'bookmarks/:entryGuid',
|
||||
),
|
||||
TypedGoRoute<BookmarkFolderAddRoute>(
|
||||
name: 'BookmarkFolderAddRoute',
|
||||
path: 'createFolder',
|
||||
),
|
||||
TypedGoRoute<BookmarkFolderEditRoute>(
|
||||
name: 'BookmarkFolderEditRoute',
|
||||
path: 'editFolder',
|
||||
),
|
||||
TypedGoRoute<BookmarkEntryAddRoute>(
|
||||
name: 'BookmarkEntryAddRoute',
|
||||
path: 'createEntry',
|
||||
),
|
||||
TypedGoRoute<BookmarkEntryEditRoute>(
|
||||
name: 'BookmarkEntryEditRoute',
|
||||
path: 'editEntry',
|
||||
),
|
||||
],
|
||||
)
|
||||
class BrowserRoute extends GoRouteData with $BrowserRoute {
|
||||
@@ -161,15 +116,6 @@ class SearchRoute extends GoRouteData with $SearchRoute {
|
||||
}
|
||||
}
|
||||
|
||||
class TorProxyRoute extends GoRouteData with $TorProxyRoute {
|
||||
const TorProxyRoute();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, GoRouterState state) {
|
||||
return const TorProxyScreen();
|
||||
}
|
||||
}
|
||||
|
||||
class ContainerDraftRoute extends GoRouteData with $ContainerDraftRoute {
|
||||
const ContainerDraftRoute();
|
||||
|
||||
@@ -268,15 +214,6 @@ class OpenSharedContentRoute extends GoRouteData with $OpenSharedContentRoute {
|
||||
}
|
||||
}
|
||||
|
||||
class HistoryRoute extends GoRouteData with $HistoryRoute {
|
||||
const HistoryRoute();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, GoRouterState state) {
|
||||
return const HistoryScreen();
|
||||
}
|
||||
}
|
||||
|
||||
class TabViewRoute extends GoRouteData with $TabViewRoute {
|
||||
const TabViewRoute();
|
||||
|
||||
@@ -294,129 +231,3 @@ class SelectProfileRoute extends GoRouteData with $SelectProfileRoute {
|
||||
return BottomSheetPage(builder: (_) => const SelectProfileDialog());
|
||||
}
|
||||
}
|
||||
|
||||
class ProfileListRoute extends GoRouteData with $ProfileListRoute {
|
||||
@override
|
||||
Widget build(BuildContext context, GoRouterState state) {
|
||||
return const ProfileListScreen();
|
||||
}
|
||||
}
|
||||
|
||||
class CreateProfileRoute extends GoRouteData with $CreateProfileRoute {
|
||||
@override
|
||||
Widget build(BuildContext context, GoRouterState state) {
|
||||
return const ProfileEditScreen(profile: null);
|
||||
}
|
||||
}
|
||||
|
||||
class EditProfileRoute extends GoRouteData with $EditProfileRoute {
|
||||
final String profile;
|
||||
|
||||
const EditProfileRoute({required this.profile});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, GoRouterState state) {
|
||||
return ProfileEditScreen(
|
||||
profile: Profile.fromJson(jsonDecode(profile) as Map<String, dynamic>),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
const BookmarkListRoute({required this.entryGuid});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, GoRouterState state) {
|
||||
return BookmarkListScreen(entryGuid: entryGuid);
|
||||
}
|
||||
}
|
||||
|
||||
class BookmarkFolderAddRoute extends GoRouteData with $BookmarkFolderAddRoute {
|
||||
final String? parentGuid;
|
||||
|
||||
const BookmarkFolderAddRoute({required this.parentGuid});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, GoRouterState state) {
|
||||
return BookmarkFolderEditScreen(parentGuid: parentGuid, folder: null);
|
||||
}
|
||||
}
|
||||
|
||||
class BookmarkFolderEditRoute extends GoRouteData
|
||||
with $BookmarkFolderEditRoute {
|
||||
final String folder;
|
||||
|
||||
const BookmarkFolderEditRoute({required this.folder});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, GoRouterState state) {
|
||||
return BookmarkFolderEditScreen(
|
||||
folder: BookmarkFolder.fromJson(
|
||||
jsonDecode(folder) as Map<String, dynamic>,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class BookmarkEntryAddRoute extends GoRouteData with $BookmarkEntryAddRoute {
|
||||
final String bookmarkInfo;
|
||||
|
||||
const BookmarkEntryAddRoute({required this.bookmarkInfo});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, GoRouterState state) {
|
||||
return BookmarkEntryEditScreen(
|
||||
initialInfo: BookmarkInfo.decode(jsonDecode(bookmarkInfo) as Object),
|
||||
exisitingEntry: null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class BookmarkEntryEditRoute extends GoRouteData with $BookmarkEntryEditRoute {
|
||||
final String bookmarkEntry;
|
||||
|
||||
const BookmarkEntryEditRoute({required this.bookmarkEntry});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, GoRouterState state) {
|
||||
return BookmarkEntryEditScreen(
|
||||
initialInfo: null,
|
||||
exisitingEntry: BookmarkEntry.fromJson(
|
||||
jsonDecode(bookmarkEntry) as Map<String, dynamic>,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user