Vaani/lib/router/constants.dart
Dr.Blank ff83c2cc63
feat: multiple theming options (#50)
* refactor: consolidate theme definitions by removing separate dark and light theme files

* feat: integrate dynamic color support and enhance theme settings management

* feat: add theme settings route and update theme management in app settings

* feat: enhance theme management by integrating high contrast support in various components

* feat: implement mode selection dialog for theme settings and enhance button functionality

* refactor: update theme import paths and consolidate theme provider files

* feat: enhance theme management by integrating theme selection based on audiobook playback

* refactor: update default value for useMaterialThemeFromSystem to false in theme settings

* refactor: adjust high contrast condition order in theme settings for consistency

* refactor: rename useMaterialThemeOfPlayingItem to useCurrentPlayerThemeThroughoutApp for clarity

* refactor: correct spelling in system theme provider and replace with updated implementation

* refactor: extract restore backup dialog into a separate widget for improved readability

* refactor: reorganize settings sections for clarity and improve restore dialog functionality
2024-10-05 10:01:08 -04:00

129 lines
2.8 KiB
Dart

// to store names of routes
part of 'router.dart';
class Routes {
static const home = _SimpleRoute(
pathName: '',
name: 'home',
);
static const onboarding = _SimpleRoute(
pathName: 'login',
name: 'onboarding',
);
static const library = _SimpleRoute(
pathName: 'library',
pathParamName: 'libraryId',
name: 'library',
);
static const libraryItem = _SimpleRoute(
pathName: 'item',
pathParamName: 'itemId',
name: 'libraryItem',
);
// Local settings
static const settings = _SimpleRoute(
pathName: 'config',
name: 'settings',
);
static const themeSettings = _SimpleRoute(
pathName: 'theme',
name: 'themeSettings',
parentRoute: settings,
);
static const autoSleepTimerSettings = _SimpleRoute(
pathName: 'autoSleepTimer',
name: 'autoSleepTimerSettings',
parentRoute: settings,
);
static const notificationSettings = _SimpleRoute(
pathName: 'notifications',
name: 'notificationSettings',
parentRoute: settings,
);
static const playerSettings = _SimpleRoute(
pathName: 'player',
name: 'playerSettings',
parentRoute: settings,
);
static const shakeDetectorSettings = _SimpleRoute(
pathName: 'shakeDetector',
name: 'shakeDetectorSettings',
parentRoute: settings,
);
// search and explore
static const search = _SimpleRoute(
pathName: 'search',
name: 'search',
// parentRoute: library,
);
static const explore = _SimpleRoute(
pathName: 'explore',
name: 'explore',
);
// downloads
static const downloads = _SimpleRoute(
pathName: 'downloads',
name: 'downloads',
);
// library browser to browse the library using author, genre, etc.
static const libraryBrowser = _SimpleRoute(
pathName: 'browser',
name: 'libraryBrowser',
// parentRoute: library,
);
// you page for the user
static const you = _SimpleRoute(
pathName: 'you',
name: 'you',
);
// user management
static const userManagement = _SimpleRoute(
pathName: 'users',
name: 'userManagement',
);
// openID callback
static const openIDCallback = _SimpleRoute(
pathName: 'callback',
name: 'openIDCallback',
parentRoute: onboarding,
);
// logs page
static const logs = _SimpleRoute(
pathName: 'logs',
name: 'logs',
);
}
// a class to store path
class _SimpleRoute {
const _SimpleRoute({
required this.pathName,
this.pathParamName,
required this.name,
this.parentRoute,
});
final String pathName;
final String? pathParamName;
final String name;
final _SimpleRoute? parentRoute;
/// the full path of the route
String get fullPath {
return '${parentRoute?.fullPath ?? ''}$localPath';
}
/// the local path of the route
String get localPath =>
'/$pathName${pathParamName != null ? '/:$pathParamName' : ''}';
}