From 21e3fe14fe4937c24bce76fc5b964d866ac0d95d Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Fri, 29 Sep 2023 15:43:36 +0200 Subject: [PATCH] refactor(neon,neon_files,neon_news,neon_notes,neon_notifications): rename NeonAppRoute to NeonBaseAppRoute Signed-off-by: Nikolas Rimikis --- packages/neon/neon/lib/src/utils/app_route.dart | 9 ++++++--- packages/neon/neon_files/lib/routes.dart | 4 ++-- packages/neon/neon_news/lib/routes.dart | 4 ++-- packages/neon/neon_notes/lib/routes.dart | 4 ++-- packages/neon/neon_notifications/lib/routes.dart | 4 ++-- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/packages/neon/neon/lib/src/utils/app_route.dart b/packages/neon/neon/lib/src/utils/app_route.dart index 544d6bfc..0985b9a7 100644 --- a/packages/neon/neon/lib/src/utils/app_route.dart +++ b/packages/neon/neon/lib/src/utils/app_route.dart @@ -4,9 +4,11 @@ import 'package:go_router/go_router.dart'; /// [RouteData] for the initial page of an app. /// /// Subclasses must override one of [build] or [redirect]. +/// Routes should be prefixed with [appsBaseRoutePrefix]. @immutable -abstract class NeonAppRoute extends GoRouteData { - const NeonAppRoute(); +abstract class NeonBaseAppRoute extends GoRouteData { + /// Creates a new app base route. + const NeonBaseAppRoute(); @override Page buildPage(final BuildContext context, final GoRouterState state) => NoTransitionPage( @@ -14,4 +16,5 @@ abstract class NeonAppRoute extends GoRouteData { ); } -const appsRoutePrefix = '/apps/'; +/// Prefix for [NeonBaseAppRoute]s. +const appsBaseRoutePrefix = '/apps/'; diff --git a/packages/neon/neon_files/lib/routes.dart b/packages/neon/neon_files/lib/routes.dart index 823bdc72..134ec818 100644 --- a/packages/neon/neon_files/lib/routes.dart +++ b/packages/neon/neon_files/lib/routes.dart @@ -7,11 +7,11 @@ import 'package:neon_files/neon_files.dart'; part 'routes.g.dart'; @TypedGoRoute( - path: '$appsRoutePrefix${AppIDs.files}', + path: '$appsBaseRoutePrefix${AppIDs.files}', name: AppIDs.files, ) @immutable -class FilesAppRoute extends NeonAppRoute { +class FilesAppRoute extends NeonBaseAppRoute { const FilesAppRoute(); @override diff --git a/packages/neon/neon_news/lib/routes.dart b/packages/neon/neon_news/lib/routes.dart index 359d2df5..14959c50 100644 --- a/packages/neon/neon_news/lib/routes.dart +++ b/packages/neon/neon_news/lib/routes.dart @@ -7,11 +7,11 @@ import 'package:neon_news/neon_news.dart'; part 'routes.g.dart'; @TypedGoRoute( - path: '$appsRoutePrefix${AppIDs.news}', + path: '$appsBaseRoutePrefix${AppIDs.news}', name: AppIDs.news, ) @immutable -class NewsAppRoute extends NeonAppRoute { +class NewsAppRoute extends NeonBaseAppRoute { const NewsAppRoute(); @override diff --git a/packages/neon/neon_notes/lib/routes.dart b/packages/neon/neon_notes/lib/routes.dart index 4bfc0d47..58444f0f 100644 --- a/packages/neon/neon_notes/lib/routes.dart +++ b/packages/neon/neon_notes/lib/routes.dart @@ -7,11 +7,11 @@ import 'package:neon_notes/neon_notes.dart'; part 'routes.g.dart'; @TypedGoRoute( - path: '$appsRoutePrefix${AppIDs.notes}', + path: '$appsBaseRoutePrefix${AppIDs.notes}', name: AppIDs.notes, ) @immutable -class NotesAppRoute extends NeonAppRoute { +class NotesAppRoute extends NeonBaseAppRoute { const NotesAppRoute(); @override diff --git a/packages/neon/neon_notifications/lib/routes.dart b/packages/neon/neon_notifications/lib/routes.dart index 233f8655..3a5a466c 100644 --- a/packages/neon/neon_notifications/lib/routes.dart +++ b/packages/neon/neon_notifications/lib/routes.dart @@ -7,11 +7,11 @@ import 'package:neon_notifications/neon_notifications.dart'; part 'routes.g.dart'; @TypedGoRoute( - path: '$appsRoutePrefix${AppIDs.notifications}', + path: '$appsBaseRoutePrefix${AppIDs.notifications}', name: AppIDs.notifications, ) @immutable -class NotificationsAppRoute extends NeonAppRoute { +class NotificationsAppRoute extends NeonBaseAppRoute { const NotificationsAppRoute(); @override