mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-25 11:22:23 +00:00
Changes
This commit is contained in:
parent
f966ab7fc5
commit
5c50a486c4
2 changed files with 50 additions and 21 deletions
|
@ -1,3 +1,4 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import 'package:adguard_home_manager/screens/home/home.dart';
|
||||
|
@ -8,6 +9,7 @@ import 'package:adguard_home_manager/screens/logs/logs.dart';
|
|||
import 'package:adguard_home_manager/screens/settings/settings.dart';
|
||||
import 'package:adguard_home_manager/widgets/layout.dart';
|
||||
|
||||
import 'package:adguard_home_manager/functions/desktop_mode.dart';
|
||||
import 'package:adguard_home_manager/routes/router_globals.dart';
|
||||
import 'package:adguard_home_manager/constants/routes_names.dart';
|
||||
|
||||
|
@ -27,7 +29,14 @@ final List<RouteBase> routes = [
|
|||
GoRoute(
|
||||
parentNavigatorKey: homeNavigatorKey,
|
||||
path: RoutesNames.home,
|
||||
builder: (context, state) => const Home(),
|
||||
pageBuilder: (context, state) {
|
||||
if (isDesktop(MediaQuery.of(context).size.width)) {
|
||||
return const NoTransitionPage(child: Home());
|
||||
}
|
||||
else {
|
||||
return const MaterialPage(child: Home());
|
||||
}
|
||||
},
|
||||
),
|
||||
]
|
||||
),
|
||||
|
@ -37,7 +46,14 @@ final List<RouteBase> routes = [
|
|||
GoRoute(
|
||||
parentNavigatorKey: clientsNavigatorKey,
|
||||
path: RoutesNames.clients,
|
||||
builder: (context, state) => const Clients(),
|
||||
pageBuilder: (context, state) {
|
||||
if (isDesktop(MediaQuery.of(context).size.width)) {
|
||||
return const NoTransitionPage(child: Clients());
|
||||
}
|
||||
else {
|
||||
return const MaterialPage(child: Clients());
|
||||
}
|
||||
},
|
||||
)
|
||||
]
|
||||
),
|
||||
|
@ -47,7 +63,14 @@ final List<RouteBase> routes = [
|
|||
GoRoute(
|
||||
parentNavigatorKey: logsNavigatorKey,
|
||||
path: RoutesNames.logs,
|
||||
builder: (context, state) => const Logs(),
|
||||
pageBuilder: (context, state) {
|
||||
if (isDesktop(MediaQuery.of(context).size.width)) {
|
||||
return const NoTransitionPage(child: Logs());
|
||||
}
|
||||
else {
|
||||
return const MaterialPage(child: Logs());
|
||||
}
|
||||
},
|
||||
)
|
||||
]
|
||||
),
|
||||
|
@ -57,7 +80,14 @@ final List<RouteBase> routes = [
|
|||
GoRoute(
|
||||
parentNavigatorKey: filtersNavigatorKey,
|
||||
path: RoutesNames.filters,
|
||||
builder: (context, state) => const Filters(),
|
||||
pageBuilder: (context, state) {
|
||||
if (isDesktop(MediaQuery.of(context).size.width)) {
|
||||
return const NoTransitionPage(child: Filters());
|
||||
}
|
||||
else {
|
||||
return const MaterialPage(child: Filters());
|
||||
}
|
||||
},
|
||||
)
|
||||
]
|
||||
),
|
||||
|
@ -67,7 +97,14 @@ final List<RouteBase> routes = [
|
|||
GoRoute(
|
||||
parentNavigatorKey: settingsNavigatorKey,
|
||||
path: RoutesNames.settings,
|
||||
builder: (context, state) => const Settings(),
|
||||
pageBuilder: (context, state) {
|
||||
if (isDesktop(MediaQuery.of(context).size.width)) {
|
||||
return const NoTransitionPage(child: Settings());
|
||||
}
|
||||
else {
|
||||
return const MaterialPage(child: Settings());
|
||||
}
|
||||
},
|
||||
)
|
||||
]
|
||||
),
|
||||
|
@ -76,7 +113,14 @@ final List<RouteBase> routes = [
|
|||
routes: [
|
||||
GoRoute(
|
||||
path: RoutesNames.connect,
|
||||
builder: (context, state) => const Connect(),
|
||||
pageBuilder: (context, state) {
|
||||
if (isDesktop(MediaQuery.of(context).size.width)) {
|
||||
return const NoTransitionPage(child: Connect());
|
||||
}
|
||||
else {
|
||||
return const MaterialPage(child: Connect());
|
||||
}
|
||||
},
|
||||
)
|
||||
]
|
||||
),
|
||||
|
|
|
@ -82,21 +82,6 @@ class BottomNavBar extends StatelessWidget {
|
|||
),
|
||||
label: translatedName(screen.name)
|
||||
)).toList(),
|
||||
// onDestinationSelected: (value) {
|
||||
// // Reset clients tab to 0 when changing screen
|
||||
// if (value != 1) {
|
||||
// appConfigProvider.setSelectedClientsTab(0);
|
||||
// }
|
||||
// // Reset logs filters when changing screen
|
||||
// if (value != 2) {
|
||||
// logsProvider.resetFilters();
|
||||
// }
|
||||
// // Reset settings selected screen
|
||||
// if (value != screens.length-1) {
|
||||
// appConfigProvider.setSelectedSettingsScreen(screen: null);
|
||||
// }
|
||||
// appConfigProvider.setSelectedScreen(value);
|
||||
// },
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue