fix: improve routing accessibility and logs
This commit is contained in:
@@ -12,22 +12,48 @@ part 'desktop_routes.g.dart';
|
||||
routes: [
|
||||
TypedGoRoute<HomeRoute>(
|
||||
path: HomeRoute.path,
|
||||
name: HomeRoute.name,
|
||||
routes: [
|
||||
TypedGoRoute<AddProfileRoute>(path: AddProfileRoute.path),
|
||||
TypedGoRoute<ProfilesRoute>(path: ProfilesRoute.path),
|
||||
TypedGoRoute<NewProfileRoute>(path: NewProfileRoute.path),
|
||||
TypedGoRoute<ProfileDetailsRoute>(path: ProfileDetailsRoute.path),
|
||||
TypedGoRoute<AddProfileRoute>(
|
||||
path: AddProfileRoute.path,
|
||||
name: AddProfileRoute.name,
|
||||
),
|
||||
TypedGoRoute<ProfilesRoute>(
|
||||
path: ProfilesRoute.path,
|
||||
name: ProfilesRoute.name,
|
||||
),
|
||||
TypedGoRoute<NewProfileRoute>(
|
||||
path: NewProfileRoute.path,
|
||||
name: NewProfileRoute.name,
|
||||
),
|
||||
TypedGoRoute<ProfileDetailsRoute>(
|
||||
path: ProfileDetailsRoute.path,
|
||||
name: ProfileDetailsRoute.name,
|
||||
),
|
||||
],
|
||||
),
|
||||
TypedGoRoute<ProxiesRoute>(path: ProxiesRoute.path),
|
||||
TypedGoRoute<LogsRoute>(path: LogsRoute.path),
|
||||
TypedGoRoute<ProxiesRoute>(
|
||||
path: ProxiesRoute.path,
|
||||
name: ProxiesRoute.name,
|
||||
),
|
||||
TypedGoRoute<LogsRoute>(
|
||||
path: LogsRoute.path,
|
||||
name: LogsRoute.name,
|
||||
),
|
||||
TypedGoRoute<SettingsRoute>(
|
||||
path: SettingsRoute.path,
|
||||
name: SettingsRoute.name,
|
||||
routes: [
|
||||
TypedGoRoute<ConfigOptionsRoute>(path: ConfigOptionsRoute.path),
|
||||
TypedGoRoute<ConfigOptionsRoute>(
|
||||
path: ConfigOptionsRoute.path,
|
||||
name: ConfigOptionsRoute.name,
|
||||
),
|
||||
],
|
||||
),
|
||||
TypedGoRoute<AboutRoute>(path: AboutRoute.path),
|
||||
TypedGoRoute<AboutRoute>(
|
||||
path: AboutRoute.path,
|
||||
name: AboutRoute.name,
|
||||
),
|
||||
],
|
||||
)
|
||||
class DesktopWrapperRoute extends ShellRouteData {
|
||||
@@ -42,31 +68,35 @@ class DesktopWrapperRoute extends ShellRouteData {
|
||||
class LogsRoute extends GoRouteData {
|
||||
const LogsRoute();
|
||||
static const path = '/logs';
|
||||
static const name = 'Logs';
|
||||
|
||||
@override
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
return const NoTransitionPage(child: LogsPage());
|
||||
return const NoTransitionPage(name: name, child: LogsPage());
|
||||
}
|
||||
}
|
||||
|
||||
class SettingsRoute extends GoRouteData {
|
||||
const SettingsRoute();
|
||||
static const path = '/settings';
|
||||
static const name = 'Settings';
|
||||
|
||||
@override
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
return const NoTransitionPage(child: SettingsPage());
|
||||
return const NoTransitionPage(name: name, child: SettingsPage());
|
||||
}
|
||||
}
|
||||
|
||||
class ConfigOptionsRoute extends GoRouteData {
|
||||
const ConfigOptionsRoute();
|
||||
static const path = 'config-options';
|
||||
static const name = 'Config Options';
|
||||
|
||||
@override
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
return const MaterialPage(
|
||||
fullscreenDialog: true,
|
||||
name: name,
|
||||
child: ConfigOptionsPage(),
|
||||
);
|
||||
}
|
||||
@@ -75,9 +105,13 @@ class ConfigOptionsRoute extends GoRouteData {
|
||||
class AboutRoute extends GoRouteData {
|
||||
const AboutRoute();
|
||||
static const path = '/about';
|
||||
static const name = 'About';
|
||||
|
||||
@override
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
return const NoTransitionPage(child: AboutPage());
|
||||
return const NoTransitionPage(
|
||||
name: name,
|
||||
child: AboutPage(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,23 +12,52 @@ part 'mobile_routes.g.dart';
|
||||
routes: [
|
||||
TypedGoRoute<HomeRoute>(
|
||||
path: HomeRoute.path,
|
||||
name: HomeRoute.name,
|
||||
routes: [
|
||||
TypedGoRoute<AddProfileRoute>(path: AddProfileRoute.path),
|
||||
TypedGoRoute<ProfilesRoute>(path: ProfilesRoute.path),
|
||||
TypedGoRoute<NewProfileRoute>(path: NewProfileRoute.path),
|
||||
TypedGoRoute<ProfileDetailsRoute>(path: ProfileDetailsRoute.path),
|
||||
TypedGoRoute<LogsRoute>(path: LogsRoute.path),
|
||||
TypedGoRoute<AddProfileRoute>(
|
||||
path: AddProfileRoute.path,
|
||||
name: AddProfileRoute.name,
|
||||
),
|
||||
TypedGoRoute<ProfilesRoute>(
|
||||
path: ProfilesRoute.path,
|
||||
name: ProfilesRoute.name,
|
||||
),
|
||||
TypedGoRoute<NewProfileRoute>(
|
||||
path: NewProfileRoute.path,
|
||||
name: NewProfileRoute.name,
|
||||
),
|
||||
TypedGoRoute<ProfileDetailsRoute>(
|
||||
path: ProfileDetailsRoute.path,
|
||||
name: ProfileDetailsRoute.name,
|
||||
),
|
||||
TypedGoRoute<LogsRoute>(
|
||||
path: LogsRoute.path,
|
||||
name: LogsRoute.name,
|
||||
),
|
||||
TypedGoRoute<SettingsRoute>(
|
||||
path: SettingsRoute.path,
|
||||
name: SettingsRoute.name,
|
||||
routes: [
|
||||
TypedGoRoute<ConfigOptionsRoute>(path: ConfigOptionsRoute.path),
|
||||
TypedGoRoute<PerAppProxyRoute>(path: PerAppProxyRoute.path),
|
||||
TypedGoRoute<ConfigOptionsRoute>(
|
||||
path: ConfigOptionsRoute.path,
|
||||
name: ConfigOptionsRoute.name,
|
||||
),
|
||||
TypedGoRoute<PerAppProxyRoute>(
|
||||
path: PerAppProxyRoute.path,
|
||||
name: PerAppProxyRoute.name,
|
||||
),
|
||||
],
|
||||
),
|
||||
TypedGoRoute<AboutRoute>(path: AboutRoute.path),
|
||||
TypedGoRoute<AboutRoute>(
|
||||
path: AboutRoute.path,
|
||||
name: AboutRoute.name,
|
||||
),
|
||||
],
|
||||
),
|
||||
TypedGoRoute<ProxiesRoute>(path: ProxiesRoute.path),
|
||||
TypedGoRoute<ProxiesRoute>(
|
||||
path: ProxiesRoute.path,
|
||||
name: ProxiesRoute.name,
|
||||
),
|
||||
],
|
||||
)
|
||||
class MobileWrapperRoute extends ShellRouteData {
|
||||
@@ -43,6 +72,7 @@ class MobileWrapperRoute extends ShellRouteData {
|
||||
class LogsRoute extends GoRouteData {
|
||||
const LogsRoute();
|
||||
static const path = 'logs';
|
||||
static const name = 'Logs';
|
||||
|
||||
static final GlobalKey<NavigatorState> $parentNavigatorKey = rootNavigatorKey;
|
||||
|
||||
@@ -50,6 +80,7 @@ class LogsRoute extends GoRouteData {
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
return const MaterialPage(
|
||||
fullscreenDialog: true,
|
||||
name: name,
|
||||
child: LogsPage(),
|
||||
);
|
||||
}
|
||||
@@ -58,6 +89,7 @@ class LogsRoute extends GoRouteData {
|
||||
class SettingsRoute extends GoRouteData {
|
||||
const SettingsRoute();
|
||||
static const path = 'settings';
|
||||
static const name = 'Settings';
|
||||
|
||||
static final GlobalKey<NavigatorState> $parentNavigatorKey = rootNavigatorKey;
|
||||
|
||||
@@ -65,6 +97,7 @@ class SettingsRoute extends GoRouteData {
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
return const MaterialPage(
|
||||
fullscreenDialog: true,
|
||||
name: name,
|
||||
child: SettingsPage(),
|
||||
);
|
||||
}
|
||||
@@ -73,6 +106,7 @@ class SettingsRoute extends GoRouteData {
|
||||
class ConfigOptionsRoute extends GoRouteData {
|
||||
const ConfigOptionsRoute();
|
||||
static const path = 'config-options';
|
||||
static const name = 'Config Options';
|
||||
|
||||
static final GlobalKey<NavigatorState> $parentNavigatorKey = rootNavigatorKey;
|
||||
|
||||
@@ -80,6 +114,7 @@ class ConfigOptionsRoute extends GoRouteData {
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
return const MaterialPage(
|
||||
fullscreenDialog: true,
|
||||
name: name,
|
||||
child: ConfigOptionsPage(),
|
||||
);
|
||||
}
|
||||
@@ -88,6 +123,7 @@ class ConfigOptionsRoute extends GoRouteData {
|
||||
class PerAppProxyRoute extends GoRouteData {
|
||||
const PerAppProxyRoute();
|
||||
static const path = 'per-app-proxy';
|
||||
static const name = 'Per-app Proxy';
|
||||
|
||||
static final GlobalKey<NavigatorState> $parentNavigatorKey = rootNavigatorKey;
|
||||
|
||||
@@ -95,6 +131,7 @@ class PerAppProxyRoute extends GoRouteData {
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
return const MaterialPage(
|
||||
fullscreenDialog: true,
|
||||
name: name,
|
||||
child: PerAppProxyPage(),
|
||||
);
|
||||
}
|
||||
@@ -103,6 +140,7 @@ class PerAppProxyRoute extends GoRouteData {
|
||||
class AboutRoute extends GoRouteData {
|
||||
const AboutRoute();
|
||||
static const path = 'about';
|
||||
static const name = 'About';
|
||||
|
||||
static final GlobalKey<NavigatorState> $parentNavigatorKey = rootNavigatorKey;
|
||||
|
||||
@@ -110,6 +148,7 @@ class AboutRoute extends GoRouteData {
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
return const MaterialPage(
|
||||
fullscreenDialog: true,
|
||||
name: name,
|
||||
child: AboutPage(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,26 +14,35 @@ final GlobalKey<NavigatorState> rootNavigatorKey = GlobalKey<NavigatorState>();
|
||||
class HomeRoute extends GoRouteData {
|
||||
const HomeRoute();
|
||||
static const path = '/';
|
||||
static const name = 'Home';
|
||||
|
||||
@override
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
return const NoTransitionPage(child: HomePage());
|
||||
return const NoTransitionPage(
|
||||
name: name,
|
||||
child: HomePage(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ProxiesRoute extends GoRouteData {
|
||||
const ProxiesRoute();
|
||||
static const path = '/proxies';
|
||||
static const name = 'Proxies';
|
||||
|
||||
@override
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
return const NoTransitionPage(child: ProxiesPage());
|
||||
return const NoTransitionPage(
|
||||
name: name,
|
||||
child: ProxiesPage(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AddProfileRoute extends GoRouteData {
|
||||
const AddProfileRoute({this.url});
|
||||
static const path = 'add';
|
||||
static const name = 'Add Profile';
|
||||
final String? url;
|
||||
|
||||
static final GlobalKey<NavigatorState> $parentNavigatorKey = rootNavigatorKey;
|
||||
@@ -42,6 +51,7 @@ class AddProfileRoute extends GoRouteData {
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
return BottomSheetPage(
|
||||
fixed: true,
|
||||
name: name,
|
||||
builder: (controller) => AddProfileModal(
|
||||
url: url,
|
||||
scrollController: controller,
|
||||
@@ -50,15 +60,17 @@ class AddProfileRoute extends GoRouteData {
|
||||
}
|
||||
}
|
||||
|
||||
@TypedGoRoute<IntroRoute>(path: IntroRoute.path)
|
||||
@TypedGoRoute<IntroRoute>(path: IntroRoute.path, name: IntroRoute.name)
|
||||
class IntroRoute extends GoRouteData {
|
||||
const IntroRoute();
|
||||
static const path = '/intro';
|
||||
static const name = 'Intro';
|
||||
|
||||
@override
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
return const MaterialPage(
|
||||
fullscreenDialog: true,
|
||||
name: name,
|
||||
child: IntroPage(),
|
||||
);
|
||||
}
|
||||
@@ -67,22 +79,25 @@ class IntroRoute extends GoRouteData {
|
||||
class ProfilesRoute extends GoRouteData {
|
||||
const ProfilesRoute();
|
||||
static const path = 'profiles';
|
||||
static const name = 'Profiles';
|
||||
|
||||
static final GlobalKey<NavigatorState> $parentNavigatorKey = rootNavigatorKey;
|
||||
|
||||
@override
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
return BottomSheetPage(
|
||||
name: name,
|
||||
builder: (controller) => ProfilesModal(scrollController: controller),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class NewProfileRoute extends GoRouteData {
|
||||
const NewProfileRoute({this.url, this.name});
|
||||
const NewProfileRoute({this.url, this.profileName});
|
||||
static const path = 'profiles/new';
|
||||
static const name = 'New Profile';
|
||||
final String? url;
|
||||
final String? name;
|
||||
final String? profileName;
|
||||
|
||||
static final GlobalKey<NavigatorState> $parentNavigatorKey = rootNavigatorKey;
|
||||
|
||||
@@ -90,10 +105,11 @@ class NewProfileRoute extends GoRouteData {
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
return MaterialPage(
|
||||
fullscreenDialog: true,
|
||||
name: name,
|
||||
child: ProfileDetailPage(
|
||||
"new",
|
||||
url: url,
|
||||
name: name,
|
||||
name: profileName,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -103,6 +119,7 @@ class ProfileDetailsRoute extends GoRouteData {
|
||||
const ProfileDetailsRoute(this.id);
|
||||
final String id;
|
||||
static const path = 'profiles/:id';
|
||||
static const name = 'Profile Details';
|
||||
|
||||
static final GlobalKey<NavigatorState> $parentNavigatorKey = rootNavigatorKey;
|
||||
|
||||
@@ -110,6 +127,7 @@ class ProfileDetailsRoute extends GoRouteData {
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
return MaterialPage(
|
||||
fullscreenDialog: true,
|
||||
name: name,
|
||||
child: ProfileDetailPage(id),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user