Refactor router

This commit is contained in:
problematicconsumer
2023-11-26 21:59:57 +03:30
parent 829d58a1a2
commit 0c1768e05e
8 changed files with 383 additions and 461 deletions

View File

@@ -7,7 +7,7 @@ bool showDrawerButton(BuildContext context) {
if (!useMobileRouter) return true;
final String location = GoRouterState.of(context).uri.path;
if (location == const HomeRoute().location ||
location == const ProfilesRoute().location) return true;
location == const ProfilesOverviewRoute().location) return true;
if (location.startsWith(const ProxiesRoute().location)) return true;
return false;
}

View File

@@ -44,7 +44,7 @@ class EmptyActiveProfileHomeBody extends HookConsumerWidget {
Text(t.home.noActiveProfileMsg),
const Gap(16),
OutlinedButton(
onPressed: () => const ProfilesRoute().push(context),
onPressed: () => const ProfilesOverviewRoute().push(context),
child: Text(t.profile.overviewPageTitle),
),
],

View File

@@ -90,7 +90,7 @@ class ProfileTile extends HookConsumerWidget {
child: InkWell(
onTap: () {
if (isMain) {
const ProfilesRoute().go(context);
const ProfilesOverviewRoute().go(context);
} else {
if (selectActiveMutation.state.isInProgress) return;
if (profile.active) return;