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