mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2025-12-09 12:39:29 +00:00
routes
This commit is contained in:
parent
ebc14a0448
commit
f8597f7430
13 changed files with 509 additions and 33 deletions
34
lib/router/constants.dart
Normal file
34
lib/router/constants.dart
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
// to store names of routes
|
||||
|
||||
part of 'router.dart';
|
||||
|
||||
class Routes {
|
||||
static const home = 'home';
|
||||
static const onboarding = 'onboarding';
|
||||
static const library = _SimpleRoute(
|
||||
pathName: 'library',
|
||||
pathParamName: 'libraryId',
|
||||
name: 'library',
|
||||
);
|
||||
static const libraryItem = _SimpleRoute(
|
||||
pathName: 'item',
|
||||
pathParamName: 'itemId',
|
||||
name: 'libraryItem',
|
||||
);
|
||||
}
|
||||
|
||||
// a class to store path
|
||||
|
||||
class _SimpleRoute {
|
||||
const _SimpleRoute({
|
||||
required this.pathName,
|
||||
required this.pathParamName,
|
||||
required this.name,
|
||||
});
|
||||
|
||||
final String pathName;
|
||||
final String pathParamName;
|
||||
final String name;
|
||||
|
||||
String get path => '/$pathName/:$pathParamName';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue