feat: Add duration_picker dependency to pubspec.yaml

This commit is contained in:
Dr-Blank 2024-06-13 18:10:10 -04:00
parent b98188d7fb
commit fbd789f989
No known key found for this signature in database
GPG key ID: 7452CC63F210A266
13 changed files with 558 additions and 49 deletions

View file

@ -21,10 +21,19 @@ class Routes {
pathParamName: 'itemId',
name: 'libraryItem',
);
// settings
static const settings = _SimpleRoute(
pathName: 'config',
name: 'settings',
);
static const autoSleepTimerSettings = _SimpleRoute(
pathName: 'autosleeptimer',
name: 'autoSleepTimerSettings',
// parentRoute: settings,
);
// search and explore
static const search = _SimpleRoute(
pathName: 'search',
name: 'search',
@ -51,9 +60,12 @@ class _SimpleRoute {
final String name;
final _SimpleRoute? parentRoute;
String get path =>
'${parentRoute?.path ?? ''}${parentRoute != null ? '/' : ''}$localPath';
/// the full path of the route
String get path {
return '${parentRoute?.path ?? ''}$localPath';
}
/// the local path of the route
String get localPath =>
'/$pathName${pathParamName != null ? '/:$pathParamName' : ''}';
}

View file

@ -4,8 +4,9 @@ import 'package:whispering_pages/features/explore/view/explore_page.dart';
import 'package:whispering_pages/features/explore/view/search_result_page.dart';
import 'package:whispering_pages/features/item_viewer/view/library_item_page.dart';
import 'package:whispering_pages/features/onboarding/view/onboarding_single_page.dart';
import 'package:whispering_pages/pages/app_settings.dart';
import 'package:whispering_pages/pages/home_page.dart';
import 'package:whispering_pages/settings/view/app_settings_page.dart';
import 'package:whispering_pages/settings/view/auto_sleep_timer_settings_page.dart';
import 'scaffold_with_nav_bar.dart';
import 'transitions/slide.dart';
@ -128,6 +129,15 @@ class MyAppRouter {
// builder: (context, state) => const AppSettingsPage(),
pageBuilder: defaultPageBuilder(const AppSettingsPage()),
),
GoRoute(
path: Routes.autoSleepTimerSettings.path,
name: Routes.autoSleepTimerSettings.name,
// builder: (context, state) =>
// const AutoSleepTimerSettingsPage(),
pageBuilder: defaultPageBuilder(
const AutoSleepTimerSettingsPage(),
),
),
],
),
],