From f5bae85b581b5efbaf2b491c807c8fcc7691d556 Mon Sep 17 00:00:00 2001 From: dzmitry-struk-surf Date: Mon, 25 Mar 2024 15:32:30 +0300 Subject: [PATCH] chore: remove app_route_names.dart --- ios/Runner.xcodeproj/project.pbxproj | 20 +++++++------- lib/features/app/app.dart | 2 +- lib/features/app/app_flow.dart | 2 +- .../debug/presentation/debug/debug_flow.dart | 3 +-- .../debug/presentation/debug/debug_wm.dart | 4 +-- .../presentation/ui_kit/ui_kit_flow.dart | 3 +-- .../{domain/entity => }/app_route_paths.dart | 4 +-- .../navigation/{service => }/app_router.dart | 6 ++--- .../{service => }/app_router.gr.dart | 20 +++++++------- .../domain/entity/app_route_names.dart | 26 ------------------- 10 files changed, 32 insertions(+), 58 deletions(-) rename lib/features/navigation/{domain/entity => }/app_route_paths.dart (74%) rename lib/features/navigation/{service => }/app_router.dart (85%) rename lib/features/navigation/{service => }/app_router.gr.dart (79%) delete mode 100644 lib/features/navigation/domain/entity/app_route_names.dart diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 8816cf93..cfb8c0b4 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -371,6 +371,7 @@ "${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework", "${BUILT_PRODUCTS_DIR}/PromisesSwift/Promises.framework", "${BUILT_PRODUCTS_DIR}/flutter_native_splash/flutter_native_splash.framework", + "${BUILT_PRODUCTS_DIR}/flutter_secure_storage/flutter_secure_storage.framework", "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework", "${BUILT_PRODUCTS_DIR}/path_provider_foundation/path_provider_foundation.framework", "${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework", @@ -389,6 +390,7 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Promises.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_native_splash.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_secure_storage.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_foundation.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_foundation.framework", @@ -484,7 +486,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = $APP_ICON; + ASSETCATALOG_COMPILER_APPICON_NAME = "$APP_ICON"; CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = ""; @@ -562,7 +564,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 9C64539A22F45CEF008DCC00 /* dev.xcconfig */; buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = $APP_ICON; + ASSETCATALOG_COMPILER_APPICON_NAME = "$APP_ICON"; CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = ""; @@ -643,7 +645,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 9C64539B22F45CEF008DCC00 /* prod.xcconfig */; buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = $APP_ICON; + ASSETCATALOG_COMPILER_APPICON_NAME = "$APP_ICON"; CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = ""; @@ -778,7 +780,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 9C64539A22F45CEF008DCC00 /* dev.xcconfig */; buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = $APP_ICON; + ASSETCATALOG_COMPILER_APPICON_NAME = "$APP_ICON"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; @@ -812,7 +814,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 9C64539A22F45CEF008DCC00 /* dev.xcconfig */; buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = $APP_ICON; + ASSETCATALOG_COMPILER_APPICON_NAME = "$APP_ICON"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; @@ -894,7 +896,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 9C64539B22F45CEF008DCC00 /* prod.xcconfig */; buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = $APP_ICON; + ASSETCATALOG_COMPILER_APPICON_NAME = "$APP_ICON"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; @@ -981,7 +983,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 9C64539A22F45CEF008DCC00 /* dev.xcconfig */; buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = $APP_ICON; + ASSETCATALOG_COMPILER_APPICON_NAME = "$APP_ICON"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; @@ -1069,7 +1071,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 9C64539B22F45CEF008DCC00 /* prod.xcconfig */; buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = $APP_ICON; + ASSETCATALOG_COMPILER_APPICON_NAME = "$APP_ICON"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; @@ -1152,7 +1154,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 9C64539A22F45CEF008DCC00 /* dev.xcconfig */; buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = $APP_ICON; + ASSETCATALOG_COMPILER_APPICON_NAME = "$APP_ICON"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; diff --git a/lib/features/app/app.dart b/lib/features/app/app.dart index 682ca932..13734f33 100644 --- a/lib/features/app/app.dart +++ b/lib/features/app/app.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; -import 'package:flutter_template/features/navigation/service/app_router.dart'; +import 'package:flutter_template/features/navigation/app_router.dart'; import 'package:flutter_template/features/theme_mode/presentation/widgets/theme_mode_builder.dart'; import 'package:flutter_template/l10n/app_localizations.g.dart'; import 'package:flutter_template/uikit/themes/app_theme_data.dart'; diff --git a/lib/features/app/app_flow.dart b/lib/features/app/app_flow.dart index fb19c81f..179b1eff 100644 --- a/lib/features/app/app_flow.dart +++ b/lib/features/app/app_flow.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_template/common/widgets/di_scope.dart'; import 'package:flutter_template/features/app/app.dart'; import 'package:flutter_template/features/app/di/app_scope.dart'; -import 'package:flutter_template/features/navigation/service/app_router.dart'; +import 'package:flutter_template/features/navigation/app_router.dart'; import 'package:flutter_template/features/theme_mode/presentation/theme_mode_provider.dart'; import 'package:nested/nested.dart'; import 'package:provider/provider.dart'; diff --git a/lib/features/debug/presentation/debug/debug_flow.dart b/lib/features/debug/presentation/debug/debug_flow.dart index 1e3a4145..17ecaf99 100644 --- a/lib/features/debug/presentation/debug/debug_flow.dart +++ b/lib/features/debug/presentation/debug/debug_flow.dart @@ -3,12 +3,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_template/common/widgets/di_scope.dart'; import 'package:flutter_template/features/debug/di/debug_scope.dart'; import 'package:flutter_template/features/debug/presentation/debug/debug_screen.dart'; -import 'package:flutter_template/features/navigation/domain/entity/app_route_names.dart'; /// {@template debug_flow.class} /// Entry of debug feature. /// {@endtemplate} -@RoutePage(name: AppRouteNames.debugScreen) +@RoutePage() class DebugFlow extends StatelessWidget implements AutoRouteWrapper { /// {@macro debug_flow.class} const DebugFlow({super.key}); diff --git a/lib/features/debug/presentation/debug/debug_wm.dart b/lib/features/debug/presentation/debug/debug_wm.dart index efed7874..c0bf182c 100644 --- a/lib/features/debug/presentation/debug/debug_wm.dart +++ b/lib/features/debug/presentation/debug/debug_wm.dart @@ -8,7 +8,7 @@ import 'package:flutter_template/features/app/di/app_scope.dart'; import 'package:flutter_template/features/debug/di/debug_scope.dart'; import 'package:flutter_template/features/debug/presentation/debug/debug_model.dart'; import 'package:flutter_template/features/debug/presentation/debug/debug_screen.dart'; -import 'package:flutter_template/features/navigation/service/app_router.dart'; +import 'package:flutter_template/features/navigation/app_router.dart'; import 'package:flutter_template/features/theme_mode/presentation/theme_mode_provider.dart'; import 'package:flutter_template/l10n/app_localizations_x.dart'; import 'package:provider/provider.dart'; @@ -125,7 +125,7 @@ class DebugScreenWM extends WidgetModel with Localizati } @override - Future openUiKit() => _router.push(const UiKitRouter()); + Future openUiKit() => _router.push(const UiKitRoute()); void _showReloadAppSnackBar() { final _ = _scaffoldMessenger.showSnackBar(SnackBar(content: Text(context.l10n.debugScreenReloadAppMessage))); diff --git a/lib/features/debug/presentation/ui_kit/ui_kit_flow.dart b/lib/features/debug/presentation/ui_kit/ui_kit_flow.dart index ea070c7c..32effd3a 100644 --- a/lib/features/debug/presentation/ui_kit/ui_kit_flow.dart +++ b/lib/features/debug/presentation/ui_kit/ui_kit_flow.dart @@ -1,12 +1,11 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; import 'package:flutter_template/features/debug/presentation/ui_kit/ui_kit_screen.dart'; -import 'package:flutter_template/features/navigation/domain/entity/app_route_names.dart'; /// {@template ui_kit_flow.class} /// Entry of Ui Kit screen. /// {@endtemplate} -@RoutePage(name: AppRouteNames.uiKitScreen) +@RoutePage() class UiKitFlow extends StatelessWidget { /// {@macro ui_kit_flow.class} const UiKitFlow({super.key}); diff --git a/lib/features/navigation/domain/entity/app_route_paths.dart b/lib/features/navigation/app_route_paths.dart similarity index 74% rename from lib/features/navigation/domain/entity/app_route_paths.dart rename to lib/features/navigation/app_route_paths.dart index f36ca591..eb8df41c 100644 --- a/lib/features/navigation/domain/entity/app_route_paths.dart +++ b/lib/features/navigation/app_route_paths.dart @@ -1,9 +1,9 @@ -/// List of all the paths that are used to navigate in temp feature. +/// List of all the paths that are used in navigation. /// /// Have to been filled with the entries like this: /// ```dart /// /// Path description. -/// static const String screenPath = 'screenPath'; +/// static const String flowPath = 'flowPath'; /// ``` abstract class AppRoutePaths { /// Path to debug screen. diff --git a/lib/features/navigation/service/app_router.dart b/lib/features/navigation/app_router.dart similarity index 85% rename from lib/features/navigation/service/app_router.dart rename to lib/features/navigation/app_router.dart index 812cb9d3..0e0a25ca 100644 --- a/lib/features/navigation/service/app_router.dart +++ b/lib/features/navigation/app_router.dart @@ -2,7 +2,7 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter_template/features/debug/presentation/debug/debug_flow.dart'; import 'package:flutter_template/features/debug/presentation/ui_kit/ui_kit_flow.dart'; import 'package:flutter_template/features/feature_example/presentation/feature_example_flow.dart'; -import 'package:flutter_template/features/navigation/domain/entity/app_route_paths.dart'; +import 'package:flutter_template/features/navigation/app_route_paths.dart'; part 'app_router.gr.dart'; @@ -19,12 +19,12 @@ class AppRouter extends _$AppRouter { @override List get routes => [ AutoRoute( - page: DebugRouter.page, + page: DebugRoute.page, path: AppRoutePaths.debugPath, initial: true, ), AutoRoute( - page: UiKitRouter.page, + page: UiKitRoute.page, path: AppRoutePaths.uiKitPath, ), AutoRoute( diff --git a/lib/features/navigation/service/app_router.gr.dart b/lib/features/navigation/app_router.gr.dart similarity index 79% rename from lib/features/navigation/service/app_router.gr.dart rename to lib/features/navigation/app_router.gr.dart index 32b110a0..550d5cd8 100644 --- a/lib/features/navigation/service/app_router.gr.dart +++ b/lib/features/navigation/app_router.gr.dart @@ -15,7 +15,7 @@ abstract class _$AppRouter extends RootStackRouter { @override final Map pagesMap = { - DebugRouter.name: (routeData) { + DebugRoute.name: (routeData) { return AutoRoutePage( routeData: routeData, child: WrappedRoute(child: const DebugFlow()), @@ -27,7 +27,7 @@ abstract class _$AppRouter extends RootStackRouter { child: WrappedRoute(child: const FeatureExampleFlow()), ); }, - UiKitRouter.name: (routeData) { + UiKitRoute.name: (routeData) { return AutoRoutePage( routeData: routeData, child: const UiKitFlow(), @@ -38,14 +38,14 @@ abstract class _$AppRouter extends RootStackRouter { /// generated route for /// [DebugFlow] -class DebugRouter extends PageRouteInfo { - const DebugRouter({List? children}) +class DebugRoute extends PageRouteInfo { + const DebugRoute({List? children}) : super( - DebugRouter.name, + DebugRoute.name, initialChildren: children, ); - static const String name = 'DebugRouter'; + static const String name = 'DebugRoute'; static const PageInfo page = PageInfo(name); } @@ -66,14 +66,14 @@ class FeatureExampleRoute extends PageRouteInfo { /// generated route for /// [UiKitFlow] -class UiKitRouter extends PageRouteInfo { - const UiKitRouter({List? children}) +class UiKitRoute extends PageRouteInfo { + const UiKitRoute({List? children}) : super( - UiKitRouter.name, + UiKitRoute.name, initialChildren: children, ); - static const String name = 'UiKitRouter'; + static const String name = 'UiKitRoute'; static const PageInfo page = PageInfo(name); } diff --git a/lib/features/navigation/domain/entity/app_route_names.dart b/lib/features/navigation/domain/entity/app_route_names.dart deleted file mode 100644 index 37357d60..00000000 --- a/lib/features/navigation/domain/entity/app_route_names.dart +++ /dev/null @@ -1,26 +0,0 @@ -/// List of all route names used in temp feature. -/// -/// Have to been filled with the entries like this: -/// ```dart -/// /// Name description. -/// static const String screenName = 'screenNameRoute'; -/// ``` -abstract class AppRouteNames { - /// TempScreen route name. - static const tempScreen = 'tempRouter'; - - /// TempScreen route name. - static const uiKitScreen = 'uiKitRouter'; - - /// DebugScreen route name. - static const debugScreen = 'debugRouter'; - - /// DashScreen route name. - static const dashScreen = 'dashRouter'; - - /// InfoScreen route name. - static const infoScreen = 'infoRouter'; - - /// LogHistoryScreen route name. - static const logHistoryScreen = 'logHistoryRouter'; -}