From 7ddb318352ea8e084425ea4a431d4cbbe71d723a Mon Sep 17 00:00:00 2001 From: Fernando Ferrara Date: Mon, 17 Jul 2023 22:44:59 -0300 Subject: [PATCH] fix: update removeSpecificFileLines method Remove lines only for the exact class, not for all the similar classes which matches the target class. For example, this avoid to delete SmartErrorDialog and ErrorDialog on the same execution because both classes ended with ErrorDialog. --- lib/src/services/file_service.dart | 6 +- lib/src/templates/compiled_template_map.dart | 121 +++++++++------- lib/src/templates/compiled_templates.dart | 137 +++---------------- test/helpers/test_helpers.mocks.dart | 11 ++ 4 files changed, 104 insertions(+), 171 deletions(-) diff --git a/lib/src/services/file_service.dart b/lib/src/services/file_service.dart index 72ab0cf..57dce42 100644 --- a/lib/src/services/file_service.dart +++ b/lib/src/services/file_service.dart @@ -136,14 +136,14 @@ class FileService { ); } List fileLines = await readFileAsLines(filePath: filePath); - fileLines.removeWhere((line) => line.contains(recaseName.snakeCase)); - fileLines.removeWhere((line) => line.contains(recaseName.pascalCase)); + fileLines.removeWhere((line) => line.contains('/${recaseName.snakeCase}')); + fileLines.removeWhere((line) => line.contains(' ${recaseName.pascalCase}')); await writeStringFile( file: File(filePath), fileContent: fileLines.join('\n'), type: FileModificationType.Modify, verbose: true, - verboseMessage: "Removed ${recaseName.pascalCase}$type from $filePath", + verboseMessage: "Removed ${recaseName.pascalCase} from $filePath", ); } diff --git a/lib/src/templates/compiled_template_map.dart b/lib/src/templates/compiled_template_map.dart index 6a245c6..66cab8f 100644 --- a/lib/src/templates/compiled_template_map.dart +++ b/lib/src/templates/compiled_template_map.dart @@ -308,18 +308,21 @@ Map> kCompiledStackedTemplates = { relativeModificationPath: 'lib/app/app.dart', modificationIdentifier: '// @stacked-dialog', modificationTemplate: '''StackedDialog(classType: {{dialogName}}),''', - modificationProblemError: 'The dialog registration should be stored in lib/app/app.dart', - modificationName: 'Add \'{{dialogName}}\' dependency to StackedApp annotations file', + modificationProblemError: + 'The dialog registration should be stored in lib/app/app.dart', + modificationName: + 'Add \'{{dialogName}}\' dependency to StackedApp annotations file', ), - ModificationFile( relativeModificationPath: 'lib/app/app.dart', modificationIdentifier: '// @stacked-import', - modificationTemplate: '''import \'package:{{packageName}}/{{{dialogsPath}}}/{{dialogFolderName}}/{{dialogFilename}}\';''', - modificationProblemError: 'The dialog registration should be stored in lib/app/app.dart', + modificationTemplate: + '''import \'package:{{packageName}}/{{{dialogsPath}}}/{{dialogFolderName}}/{{dialogFilename}}\';''', + modificationProblemError: + 'The dialog registration should be stored in lib/app/app.dart', modificationName: 'Add import for \'{{dialogName}}\' class', ), - ], + ], ), }, 'view': { @@ -347,18 +350,22 @@ Map> kCompiledStackedTemplates = { relativeModificationPath: 'lib/app/app.dart', modificationIdentifier: '// @stacked-route', modificationTemplate: '''MaterialRoute(page: {{viewName}}),''', - modificationProblemError: 'The structure of your stacked application is invalid. The app.dart file should be located in lib/app/', - modificationName: 'Add {{viewName}} route where @StackedApp annotation is located', + modificationProblemError: + 'The structure of your stacked application is invalid. The app.dart file should be located in lib/app/', + modificationName: + 'Add {{viewName}} route where @StackedApp annotation is located', ), - ModificationFile( relativeModificationPath: 'lib/app/app.dart', modificationIdentifier: '// @stacked-import', - modificationTemplate: '''import \'package:{{packageName}}/{{{viewImportPath}}}/{{viewFolderName}}/{{viewFileName}}\';''', - modificationProblemError: 'The structure of your stacked application is invalid. The app.dart file should be located in lib/app/', - modificationName: 'Add {{viewName}} route import where @StackedApp annotation is located', + modificationTemplate: + '''import \'package:{{packageName}}/{{{viewImportPath}}}/{{viewFolderName}}/{{viewFileName}}\';''', + modificationProblemError: + 'The structure of your stacked application is invalid. The app.dart file should be located in lib/app/', + modificationName: + 'Add {{viewName}} route import where @StackedApp annotation is located', ), - ], + ], ), 'web': StackedTemplate( templateFiles: [ @@ -392,18 +399,22 @@ Map> kCompiledStackedTemplates = { relativeModificationPath: 'lib/app/app.dart', modificationIdentifier: '// @stacked-route', modificationTemplate: '''CustomRoute(page: {{viewName}}),''', - modificationProblemError: 'The structure of your stacked application is invalid. The app.dart file should be located in lib/app/', - modificationName: 'Add {{viewName}} route where @StackedApp annotation is located', + modificationProblemError: + 'The structure of your stacked application is invalid. The app.dart file should be located in lib/app/', + modificationName: + 'Add {{viewName}} route where @StackedApp annotation is located', ), - ModificationFile( relativeModificationPath: 'lib/app/app.dart', modificationIdentifier: '// @stacked-import', - modificationTemplate: '''import \'package:{{packageName}}/{{{viewImportPath}}}/{{viewFolderName}}/{{viewFileName}}\';''', - modificationProblemError: 'The structure of your stacked application is invalid. The app.dart file should be located in lib/app/', - modificationName: 'Add {{viewName}} route import where @StackedApp annotation is located', + modificationTemplate: + '''import \'package:{{packageName}}/{{{viewImportPath}}}/{{viewFolderName}}/{{viewFileName}}\';''', + modificationProblemError: + 'The structure of your stacked application is invalid. The app.dart file should be located in lib/app/', + modificationName: + 'Add {{viewName}} route import where @StackedApp annotation is located', ), - ], + ], ), }, 'service': { @@ -422,63 +433,72 @@ Map> kCompiledStackedTemplates = { ModificationFile( relativeModificationPath: 'test/helpers/test_helpers.dart', modificationIdentifier: '// @stacked-mock-create', - modificationTemplate: '''Mock{{serviceName}} getAndRegister{{serviceName}}() { + modificationTemplate: + '''Mock{{serviceName}} getAndRegister{{serviceName}}() { _removeRegistrationIfExists<{{serviceName}}>(); final service = Mock{{serviceName}}(); {{locatorName}}.registerSingleton<{{serviceName}}>(service); return service; }''', - modificationProblemError: 'The test mocks and helpers should be stored in test/helpers/test_helpers.dart', + modificationProblemError: + 'The test mocks and helpers should be stored in test/helpers/test_helpers.dart', modificationName: 'Add {{serviceName}} mock to test helpers', ), - ModificationFile( relativeModificationPath: 'lib/app/app.dart', modificationIdentifier: '// @stacked-service', - modificationTemplate: '''LazySingleton(classType: {{serviceName}}),''', - modificationProblemError: 'The service registration should be stored in lib/app/app.dart', - modificationName: 'Add {{serviceName}} dependency to StackedApp annotations file', + modificationTemplate: + '''LazySingleton(classType: {{serviceName}}),''', + modificationProblemError: + 'The service registration should be stored in lib/app/app.dart', + modificationName: + 'Add {{serviceName}} dependency to StackedApp annotations file', ), - ModificationFile( relativeModificationPath: 'lib/app/app.dart', modificationIdentifier: '// @stacked-import', - modificationTemplate: '''import \'package:{{packageName}}/{{{serviceImportPath}}}/{{serviceFilename}}\';''', - modificationProblemError: 'The service registration should be stored in lib/app/app.dart', - modificationName: 'Add {{serviceName}} import to StackedApp annotations file', + modificationTemplate: + '''import \'package:{{packageName}}/{{{serviceImportPath}}}/{{serviceFilename}}\';''', + modificationProblemError: + 'The service registration should be stored in lib/app/app.dart', + modificationName: + 'Add {{serviceName}} import to StackedApp annotations file', ), - ModificationFile( relativeModificationPath: 'test/helpers/test_helpers.dart', modificationIdentifier: '// @stacked-mock-spec', - modificationTemplate: '''MockSpec<{{serviceName}}>(onMissingStub: OnMissingStub.returnDefault),''', - modificationProblemError: 'The test mocks and helpers should be stored in test/helpers/test_helpers.dart', + modificationTemplate: + '''MockSpec<{{serviceName}}>(onMissingStub: OnMissingStub.returnDefault),''', + modificationProblemError: + 'The test mocks and helpers should be stored in test/helpers/test_helpers.dart', modificationName: 'Create {{serviceName}} mock to test helpers', ), - ModificationFile( relativeModificationPath: 'test/helpers/test_helpers.dart', modificationIdentifier: '// @stacked-mock-register', modificationTemplate: '''getAndRegister{{serviceName}}();''', - modificationProblemError: 'The test mocks and helpers should be stored in test/helpers/test_helpers.dart', + modificationProblemError: + 'The test mocks and helpers should be stored in test/helpers/test_helpers.dart', modificationName: 'Add {{serviceName}} register to test helpers', ), - ModificationFile( relativeModificationPath: 'test/helpers/test_helpers.dart', modificationIdentifier: '// @stacked-import', - modificationTemplate: '''import \'package:{{packageName}}/{{{serviceImportPath}}}/{{serviceFilename}}\';''', - modificationProblemError: 'It seems your test_helpers.dart file is not in test/helpers/test_helpers.dart. Add a stacked.json file and set the path for \'test_helpers_path\' to the folder we can locate your test_helpers.dart file', + modificationTemplate: + '''import \'package:{{packageName}}/{{{serviceImportPath}}}/{{serviceFilename}}\';''', + modificationProblemError: + 'It seems your test_helpers.dart file is not in test/helpers/test_helpers.dart. Add a stacked.json file and set the path for \'test_helpers_path\' to the folder we can locate your test_helpers.dart file', modificationName: 'Add {{serviceName}} import to test helpers', ), - ], + ], ), }, 'bottom_sheet': { 'empty': StackedTemplate( templateFiles: [ TemplateFile( - relativeOutputPath: kBottomSheetEmptyTemplateGenericSheetModelTestPath, + relativeOutputPath: + kBottomSheetEmptyTemplateGenericSheetModelTestPath, content: kBottomSheetEmptyTemplateGenericSheetModelTestContent, fileType: FileType.text), TemplateFile( @@ -486,7 +506,8 @@ return service; content: kBottomSheetEmptyTemplateGenericSheetModelContent, fileType: FileType.text), TemplateFile( - relativeOutputPath: kBottomSheetEmptyTemplateGenericSheetUseModelPath, + relativeOutputPath: + kBottomSheetEmptyTemplateGenericSheetUseModelPath, content: kBottomSheetEmptyTemplateGenericSheetUseModelContent, fileType: FileType.text), TemplateFile( @@ -498,19 +519,23 @@ return service; ModificationFile( relativeModificationPath: 'lib/app/app.dart', modificationIdentifier: '// @stacked-bottom-sheet', - modificationTemplate: '''StackedBottomsheet(classType: {{sheetName}}),''', - modificationProblemError: 'The bottom sheet registration should be stored in lib/app/app.dart', - modificationName: 'Add \'{{sheetName}}\' dependency to StackedApp annotations file', + modificationTemplate: + '''StackedBottomsheet(classType: {{sheetName}}),''', + modificationProblemError: + 'The bottom sheet registration should be stored in lib/app/app.dart', + modificationName: + 'Add \'{{sheetName}}\' dependency to StackedApp annotations file', ), - ModificationFile( relativeModificationPath: 'lib/app/app.dart', modificationIdentifier: '// @stacked-import', - modificationTemplate: '''import \'package:{{packageName}}/{{{bottomSheetsPath}}}/{{sheetFolderName}}/{{sheetFilename}}\';''', - modificationProblemError: 'The bottom sheet registration should be stored in lib/app/app.dart', + modificationTemplate: + '''import \'package:{{packageName}}/{{{bottomSheetsPath}}}/{{sheetFolderName}}/{{sheetFilename}}\';''', + modificationProblemError: + 'The bottom sheet registration should be stored in lib/app/app.dart', modificationName: 'Add import for \'{{sheetName}}\' class', ), - ], + ], ), }, }; diff --git a/lib/src/templates/compiled_templates.dart b/lib/src/templates/compiled_templates.dart index 441fbc5..b77ae21 100644 --- a/lib/src/templates/compiled_templates.dart +++ b/lib/src/templates/compiled_templates.dart @@ -1,11 +1,9 @@ /// NOTE: This is generated code from the compileTemplates command. Do not modify by hand /// This file should be checked into source control. - // -------- StackedJsonStk Template Data ---------- -const String kAppWebTemplateStackedJsonStkPath = - 'stacked.json.stk'; +const String kAppWebTemplateStackedJsonStkPath = 'stacked.json.stk'; const String kAppWebTemplateStackedJsonStkContent = ''' { @@ -29,7 +27,6 @@ const String kAppWebTemplateStackedJsonStkContent = ''' // -------------------------------------------------- - // -------- UnknownViewmodelTest Template Data ---------- const String kAppWebTemplateUnknownViewmodelTestPath = @@ -51,7 +48,6 @@ void main() { // -------------------------------------------------- - // -------- HomeViewmodelTest Template Data ---------- const String kAppWebTemplateHomeViewmodelTestPath = @@ -103,7 +99,6 @@ void main() { // -------------------------------------------------- - // -------- NoticeSheetModelTest Template Data ---------- const String kAppWebTemplateNoticeSheetModelTestPath = @@ -126,7 +121,6 @@ void main() { // -------------------------------------------------- - // -------- InfoAlertDialogModelTest Template Data ---------- const String kAppWebTemplateInfoAlertDialogModelTestPath = @@ -149,7 +143,6 @@ void main() { // -------------------------------------------------- - // -------- TestHelpers Template Data ---------- const String kAppWebTemplateTestHelpersPath = @@ -239,11 +232,9 @@ void _removeRegistrationIfExists() { // -------------------------------------------------- - // -------- BuildYamlStk Template Data ---------- -const String kAppWebTemplateBuildYamlStkPath = - 'build.yaml.stk'; +const String kAppWebTemplateBuildYamlStkPath = 'build.yaml.stk'; const String kAppWebTemplateBuildYamlStkContent = ''' targets: @@ -256,11 +247,9 @@ targets: // -------------------------------------------------- - // -------- MainIconPngStk Template Data ---------- -const String kAppWebTemplateMainIconPngStkPath = - 'web/main-icon.png.stk'; +const String kAppWebTemplateMainIconPngStkPath = 'web/main-icon.png.stk'; const String kAppWebTemplateMainIconPngStkContent = ''' iVBORw0KGgoAAAANSUhEUgAAALMAAACzCAYAAADCFC3zAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAN5SURBVHgB7daLjVNBDEDRF0QjVEIrdMLSAS3RyZZAByGWdqUQ5Z/5eGbOkSw3cC152wAAAAAAAAAAAAAAAACAjHZbYfuDDW77tdvt3raCvmzQXvGQg5hprUrIQcy0VC3kIGZaqRpyEDMtVA85iJnamoQcxExNzUIOYqaWpiEHMVND85CDmCmtS8hBzJTULeQgZkrpGnIQMyV0DzmImVelCDmImVekCTmImWelCjmImWekCzmImUelDDmImUekDTmImXulDjmImXukDzmImVuGCDmImWuGCTmImUuGCjmImXOGCzmImVNDhhzEzLFhQw5i5tPQIQcxE4YPOYiZKUIOYl7bNCEHMa9rqpCDmNc0XchBzOuZMuQg5rVMG3IQ8zqmDjmIeQ3ThxzEPL8lQg5intsyIQcxz2upkIOY57RcyEHM81ky5CDmuSwbchDzPJYOOYh5DsuHHMQ8PiF/EPPYhHxEzOMS8gkxj0nIZ4h5PEK+QMxjEfIVYh6HkG8Q8xiEfAcx5yfkO4k5NyE/QMx5CflBYs5JyE8Qcz5CfpKYcxHyC8Sch5BfJOYchFyAmPsTciFi7kvIBYm5HyEXJuY+hFyBmNsTciVibkvIFYm5HSFXttsK2+/3bxunvh/mz8axv4fj/r0VVDxm/nc47p+H9bZx6v0Q87etIG9GRUJuS8yVCLk9MVcg5D7EXJiQ+xFzQULuS8yFCLk/MRcg5BzE/CIh5yHmFwg5FzE/Scj5iPkJQs5JzA8Scl5ifoCQcxPznYScn5jvIOQxiPkGIY9DzFcIeSxivkDI4xHzGUIek5hPCHlcYj4i5LGJ+YOQxyfmTcizWD5mIc9j6ZiFPJdlYxbyfJaMWchzWi5mIc9rqZiFPLdlYhby/JaIWchrmD5mIa9j6piFvJZpYxbyeqaMWchrmi5mIa9rqpiFvLZpYhYyU8QsZMLwMQuZT0PHLGSODRuzkDk1ZMxC5pzhYhYylwwVs5C5ZpiYhcwtQ8QsZO6RPmYhc6/UMQuZR6SNWcg8KmXMQuYZ6WIWMs9KFbOQeUWamIXMq1LELGRK6B6zkCmla8xCpqRuMQuZ0rrELGRqaB6zkKmlacxCpqZmMQuZ2prELGRaqB6zkGmlasxCpqVqMQuZ1qrELGR6+LoVdgj5x2HFvG9w2fsGAAAAAAAAAAAAAAAAACzhH8sFZqawpyetAAAAAElFTkSuQmCC @@ -268,11 +257,9 @@ iVBORw0KGgoAAAANSUhEUgAAALMAAACzCAYAAADCFC3zAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNS // -------------------------------------------------- - // -------- IndexHtmlStk Template Data ---------- -const String kAppWebTemplateIndexHtmlStkPath = - 'web/index.html.stk'; +const String kAppWebTemplateIndexHtmlStkPath = 'web/index.html.stk'; const String kAppWebTemplateIndexHtmlStkContent = ''' @@ -450,11 +437,9 @@ const String kAppWebTemplateIndexHtmlStkContent = ''' // -------------------------------------------------- - // -------- FaviconPngStk Template Data ---------- -const String kAppWebTemplateFaviconPngStkPath = - 'web/favicon.png.stk'; +const String kAppWebTemplateFaviconPngStkPath = 'web/favicon.png.stk'; const String kAppWebTemplateFaviconPngStkContent = ''' iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHaSURBVHgBpVTNasJAEN7dxLQl+FNEFBRR8VCQgo+gryCkh9499CnUg/gMvo3eFWw9eBLS4sWT2oOHRLOdWWLYxkRT+8GS3cnkm28mM0tIMOhpwzmn7plKdurawz9EdLtdNhqNWKvVekyn0ynLsghjTPg4jsNt26a6rnO09/v9r2Qy6UwmkwOlwoX7yZVqtWqA07v78uqKx+NmsVhsw179Jc4wDKVcLrejEvkXCHlBDlmdlkgkPm8lhKw+arWahipRKikUCspqtSqe2FOpFKnX6+QSZrMZ2W63Yr/b7Z6htshl45kOh8MnOWKj0eCXAD8vSKmOf54ho6qqnEREr9fDbjizZzIZikBCut/v6X/IENBeQikSck3TrnFdJJMghJ3V0L86nc5ZHbHOsk82m9WFUCTEzg8DkEVRhpOE6jhD57CUo5IR4tVQpMyCUg5KM0LKorH5crn8lqNhY4/HY9JsNkMVYWPLWK/XXutRmJQHGPQ5uXH0cGxLpdK9SNeVe8jlcgNyI2CWB6ZpHjwDjgxGyOfzb3+5JIBoXqlUXuG2uSOnHpQCUSi0slgs7qCNVAwCEHXZbDZYV+8sZpYxJxaLHaFc1nQ6PYLZCcsAy6BIT0U6eza83X2CBH4AHNJFlWlQookAAAAASUVORK5CYII= @@ -462,11 +447,9 @@ iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNS // -------------------------------------------------- - // -------- READMEMdStk Template Data ---------- -const String kAppWebTemplateREADMEMdStkPath = - 'README.md.stk'; +const String kAppWebTemplateREADMEMdStkPath = 'README.md.stk'; const String kAppWebTemplateREADMEMdStkContent = ''' # {{packageName}} @@ -476,11 +459,9 @@ const String kAppWebTemplateREADMEMdStkContent = ''' // -------------------------------------------------- - // -------- Main Template Data ---------- -const String kAppWebTemplateMainPath = - 'lib/main.dart.stk'; +const String kAppWebTemplateMainPath = 'lib/main.dart.stk'; const String kAppWebTemplateMainContent = ''' import 'package:flutter/material.dart'; @@ -522,7 +503,6 @@ class MainApp extends StatelessWidget { // -------------------------------------------------- - // -------- AppConstants Template Data ---------- const String kAppWebTemplateAppConstantsPath = @@ -539,11 +519,9 @@ const double kdDesktopMaxContentHeight = 750; // -------------------------------------------------- - // -------- UiHelpers Template Data ---------- -const String kAppWebTemplateUiHelpersPath = - 'lib/ui/common/ui_helpers.dart.stk'; +const String kAppWebTemplateUiHelpersPath = 'lib/ui/common/ui_helpers.dart.stk'; const String kAppWebTemplateUiHelpersContent = ''' import 'dart:math'; @@ -629,7 +607,6 @@ double getResponsiveFontSize(BuildContext context, // -------------------------------------------------- - // -------- AppStrings Template Data ---------- const String kAppWebTemplateAppStringsPath = @@ -644,11 +621,9 @@ const String ksHomeBottomSheetDescription = // -------------------------------------------------- - // -------- AppColors Template Data ---------- -const String kAppWebTemplateAppColorsPath = - 'lib/ui/common/app_colors.dart.stk'; +const String kAppWebTemplateAppColorsPath = 'lib/ui/common/app_colors.dart.stk'; const String kAppWebTemplateAppColorsContent = ''' import 'package:flutter/material.dart'; @@ -667,7 +642,6 @@ const Color kcBackgroundColor = kcDarkGreyColor; // -------------------------------------------------- - // -------- NoticeSheetModel Template Data ---------- const String kAppWebTemplateNoticeSheetModelPath = @@ -682,7 +656,6 @@ class NoticeSheetModel extends BaseViewModel {} // -------------------------------------------------- - // -------- NoticeSheet Template Data ---------- const String kAppWebTemplateNoticeSheetPath = @@ -751,7 +724,6 @@ class NoticeSheet extends StackedView { // -------------------------------------------------- - // -------- InfoAlertDialogModel Template Data ---------- const String kAppWebTemplateInfoAlertDialogModelPath = @@ -766,7 +738,6 @@ class InfoAlertDialogModel extends BaseViewModel {} // -------------------------------------------------- - // -------- InfoAlertDialog Template Data ---------- const String kAppWebTemplateInfoAlertDialogPath = @@ -886,7 +857,6 @@ class InfoAlertDialog extends StackedView { // -------------------------------------------------- - // -------- HomeViewDesktop Template Data ---------- const String kAppWebTemplateHomeViewDesktopPath = @@ -973,7 +943,6 @@ class HomeViewDesktop extends ViewModelWidget { // -------------------------------------------------- - // -------- HomeViewMobile Template Data ---------- const String kAppWebTemplateHomeViewMobilePath = @@ -1060,7 +1029,6 @@ class HomeViewMobile extends ViewModelWidget { // -------------------------------------------------- - // -------- HomeView Template Data ---------- const String kAppWebTemplateHomeViewPath = @@ -1103,7 +1071,6 @@ class HomeView extends StackedView { // -------------------------------------------------- - // -------- HomeViewmodel Template Data ---------- const String kAppWebTemplateHomeViewmodelPath = @@ -1151,7 +1118,6 @@ class HomeViewModel extends BaseViewModel { // -------------------------------------------------- - // -------- HomeViewTablet Template Data ---------- const String kAppWebTemplateHomeViewTabletPath = @@ -1238,7 +1204,6 @@ class HomeViewTablet extends ViewModelWidget { // -------------------------------------------------- - // -------- UnknownView Template Data ---------- const String kAppWebTemplateUnknownViewPath = @@ -1281,7 +1246,6 @@ class UnknownView extends StackedView { // -------------------------------------------------- - // -------- UnknownViewDesktop Template Data ---------- const String kAppWebTemplateUnknownViewDesktopPath = @@ -1337,7 +1301,6 @@ class UnknownViewDesktop extends ViewModelWidget { // -------------------------------------------------- - // -------- UnknownViewTablet Template Data ---------- const String kAppWebTemplateUnknownViewTabletPath = @@ -1393,7 +1356,6 @@ class UnknownViewTablet extends ViewModelWidget { // -------------------------------------------------- - // -------- UnknownViewmodel Template Data ---------- const String kAppWebTemplateUnknownViewmodelPath = @@ -1408,7 +1370,6 @@ class UnknownViewModel extends BaseViewModel {} // -------------------------------------------------- - // -------- UnknownViewMobile Template Data ---------- const String kAppWebTemplateUnknownViewMobilePath = @@ -1463,7 +1424,6 @@ class UnknownViewMobile extends ViewModelWidget { // -------------------------------------------------- - // -------- StartupViewmodel Template Data ---------- const String kAppWebTemplateStartupViewmodelPath = @@ -1491,7 +1451,6 @@ class StartupViewModel extends BaseViewModel { // -------------------------------------------------- - // -------- StartupView Template Data ---------- const String kAppWebTemplateStartupViewPath = @@ -1558,7 +1517,6 @@ class StartupView extends StackedView { // -------------------------------------------------- - // -------- ScaleOnHover Template Data ---------- const String kAppWebTemplateScaleOnHoverPath = @@ -1607,7 +1565,6 @@ class _ScaleOnHoverState extends State { // -------------------------------------------------- - // -------- TranslateOnHover Template Data ---------- const String kAppWebTemplateTranslateOnHoverPath = @@ -1664,11 +1621,9 @@ class _TranslateOnHoverState extends State { // -------------------------------------------------- - // -------- App Template Data ---------- -const String kAppWebTemplateAppPath = - 'lib/app/app.dart.stk'; +const String kAppWebTemplateAppPath = 'lib/app/app.dart.stk'; const String kAppWebTemplateAppContent = ''' import 'package:{{packageName}}/{{{bottomSheetsPath}}}/notice/notice_sheet.dart'; @@ -1712,7 +1667,6 @@ class App {} // -------------------------------------------------- - // -------- HoverExtensions Template Data ---------- const String kAppWebTemplateHoverExtensionsPath = @@ -1767,11 +1721,9 @@ extension HoverExtensions on Widget { // -------------------------------------------------- - // -------- PubspecYamlStk Template Data ---------- -const String kAppWebTemplatePubspecYamlStkPath = - 'pubspec.yaml.stk'; +const String kAppWebTemplatePubspecYamlStkPath = 'pubspec.yaml.stk'; const String kAppWebTemplatePubspecYamlStkContent = ''' name: {{packageName}} @@ -1806,11 +1758,9 @@ flutter: // -------------------------------------------------- - // -------- SettingsJsonStk Template Data ---------- -const String kAppWebTemplateSettingsJsonStkPath = - '.vscode/settings.json.stk'; +const String kAppWebTemplateSettingsJsonStkPath = '.vscode/settings.json.stk'; const String kAppWebTemplateSettingsJsonStkContent = ''' { @@ -1824,11 +1774,9 @@ const String kAppWebTemplateSettingsJsonStkContent = ''' // -------------------------------------------------- - // -------- StackedJsonStk Template Data ---------- -const String kAppMobileTemplateStackedJsonStkPath = - 'stacked.json.stk'; +const String kAppMobileTemplateStackedJsonStkPath = 'stacked.json.stk'; const String kAppMobileTemplateStackedJsonStkContent = ''' { @@ -1852,7 +1800,6 @@ const String kAppMobileTemplateStackedJsonStkContent = ''' // -------------------------------------------------- - // -------- HomeViewmodelTest Template Data ---------- const String kAppMobileTemplateHomeViewmodelTestPath = @@ -1904,7 +1851,6 @@ void main() { // -------------------------------------------------- - // -------- NoticeSheetModelTest Template Data ---------- const String kAppMobileTemplateNoticeSheetModelTestPath = @@ -1927,7 +1873,6 @@ void main() { // -------------------------------------------------- - // -------- InfoAlertDialogModelTest Template Data ---------- const String kAppMobileTemplateInfoAlertDialogModelTestPath = @@ -1950,7 +1895,6 @@ void main() { // -------------------------------------------------- - // -------- TestHelpers Template Data ---------- const String kAppMobileTemplateTestHelpersPath = @@ -2040,11 +1984,9 @@ void _removeRegistrationIfExists() { // -------------------------------------------------- - // -------- READMEMdStk Template Data ---------- -const String kAppMobileTemplateREADMEMdStkPath = - 'README.md.stk'; +const String kAppMobileTemplateREADMEMdStkPath = 'README.md.stk'; const String kAppMobileTemplateREADMEMdStkContent = ''' # {{packageName}} @@ -2054,11 +1996,9 @@ const String kAppMobileTemplateREADMEMdStkContent = ''' // -------------------------------------------------- - // -------- Main Template Data ---------- -const String kAppMobileTemplateMainPath = - 'lib/main.dart.stk'; +const String kAppMobileTemplateMainPath = 'lib/main.dart.stk'; const String kAppMobileTemplateMainContent = ''' import 'package:flutter/material.dart'; @@ -2096,7 +2036,6 @@ class MainApp extends StatelessWidget { // -------------------------------------------------- - // -------- UiHelpers Template Data ---------- const String kAppMobileTemplateUiHelpersPath = @@ -2186,7 +2125,6 @@ double getResponsiveFontSize(BuildContext context, // -------------------------------------------------- - // -------- AppStrings Template Data ---------- const String kAppMobileTemplateAppStringsPath = @@ -2201,7 +2139,6 @@ const String ksHomeBottomSheetDescription = // -------------------------------------------------- - // -------- AppColors Template Data ---------- const String kAppMobileTemplateAppColorsPath = @@ -2222,7 +2159,6 @@ const Color kcBackgroundColor = kcDarkGreyColor; // -------------------------------------------------- - // -------- NoticeSheetModel Template Data ---------- const String kAppMobileTemplateNoticeSheetModelPath = @@ -2237,7 +2173,6 @@ class NoticeSheetModel extends BaseViewModel {} // -------------------------------------------------- - // -------- NoticeSheet Template Data ---------- const String kAppMobileTemplateNoticeSheetPath = @@ -2306,7 +2241,6 @@ class NoticeSheet extends StackedView { // -------------------------------------------------- - // -------- InfoAlertDialogModel Template Data ---------- const String kAppMobileTemplateInfoAlertDialogModelPath = @@ -2321,7 +2255,6 @@ class InfoAlertDialogModel extends BaseViewModel {} // -------------------------------------------------- - // -------- InfoAlertDialog Template Data ---------- const String kAppMobileTemplateInfoAlertDialogPath = @@ -2441,7 +2374,6 @@ class InfoAlertDialog extends StackedView { // -------------------------------------------------- - // -------- HomeViewV1 Template Data ---------- const String kAppMobileTemplateHomeViewV1Path = @@ -2530,7 +2462,6 @@ class HomeView extends StatelessWidget { // -------------------------------------------------- - // -------- HomeView Template Data ---------- const String kAppMobileTemplateHomeViewPath = @@ -2626,7 +2557,6 @@ class HomeView extends StackedView { // -------------------------------------------------- - // -------- HomeViewmodel Template Data ---------- const String kAppMobileTemplateHomeViewmodelPath = @@ -2674,7 +2604,6 @@ class HomeViewModel extends BaseViewModel { // -------------------------------------------------- - // -------- StartupViewmodel Template Data ---------- const String kAppMobileTemplateStartupViewmodelPath = @@ -2704,7 +2633,6 @@ class StartupViewModel extends BaseViewModel { // -------------------------------------------------- - // -------- StartupViewV1 Template Data ---------- const String kAppMobileTemplateStartupViewV1Path = @@ -2770,7 +2698,6 @@ class StartupView extends StatelessWidget { // -------------------------------------------------- - // -------- StartupView Template Data ---------- const String kAppMobileTemplateStartupViewPath = @@ -2837,11 +2764,9 @@ class StartupView extends StackedView { // -------------------------------------------------- - // -------- App Template Data ---------- -const String kAppMobileTemplateAppPath = - 'lib/app/app.dart.stk'; +const String kAppMobileTemplateAppPath = 'lib/app/app.dart.stk'; const String kAppMobileTemplateAppContent = ''' import 'package:{{packageName}}/{{{bottomSheetsPath}}}/notice/notice_sheet.dart'; @@ -2879,11 +2804,9 @@ class App {} // -------------------------------------------------- - // -------- PubspecYamlStk Template Data ---------- -const String kAppMobileTemplatePubspecYamlStkPath = - 'pubspec.yaml.stk'; +const String kAppMobileTemplatePubspecYamlStkPath = 'pubspec.yaml.stk'; const String kAppMobileTemplatePubspecYamlStkContent = ''' name: {{packageName}} @@ -2915,7 +2838,6 @@ flutter: // -------------------------------------------------- - // -------- SettingsJsonStk Template Data ---------- const String kAppMobileTemplateSettingsJsonStkPath = @@ -2933,7 +2855,6 @@ const String kAppMobileTemplateSettingsJsonStkContent = ''' // -------------------------------------------------- - // -------- GenericModelTest Template Data ---------- const String kWidgetEmptyTemplateGenericModelTestPath = @@ -2956,7 +2877,6 @@ void main() { // -------------------------------------------------- - // -------- GenericUseModel Template Data ---------- const String kWidgetEmptyTemplateGenericUseModelPath = @@ -2989,7 +2909,6 @@ class {{widgetName}} extends StackedView<{{widgetModelName}}> { // -------------------------------------------------- - // -------- Generic Template Data ---------- const String kWidgetEmptyTemplateGenericPath = @@ -3011,7 +2930,6 @@ class {{widgetName}} extends StatelessWidget { // -------------------------------------------------- - // -------- GenericModel Template Data ---------- const String kWidgetEmptyTemplateGenericModelPath = @@ -3025,7 +2943,6 @@ class {{widgetModelName}} extends BaseViewModel {} // -------------------------------------------------- - // -------- GenericDialogModelTest Template Data ---------- const String kDialogEmptyTemplateGenericDialogModelTestPath = @@ -3048,7 +2965,6 @@ void main() { // -------------------------------------------------- - // -------- GenericDialogModel Template Data ---------- const String kDialogEmptyTemplateGenericDialogModelPath = @@ -3063,7 +2979,6 @@ class {{dialogModelName}} extends BaseViewModel {} // -------------------------------------------------- - // -------- GenericDialogUseModel Template Data ---------- const String kDialogEmptyTemplateGenericDialogUseModelPath = @@ -3184,7 +3099,6 @@ class {{dialogName}} extends StackedView<{{dialogModelName}}> { // -------------------------------------------------- - // -------- GenericDialog Template Data ---------- const String kDialogEmptyTemplateGenericDialogPath = @@ -3294,7 +3208,6 @@ class {{dialogName}} extends StatelessWidget { // -------------------------------------------------- - // -------- GenericViewmodelTest Template Data ---------- const String kViewEmptyTemplateGenericViewmodelTestPath = @@ -3317,7 +3230,6 @@ void main() { // -------------------------------------------------- - // -------- GenericViewmodel Template Data ---------- const String kViewEmptyTemplateGenericViewmodelPath = @@ -3331,7 +3243,6 @@ class {{viewModelName}} extends BaseViewModel {} // -------------------------------------------------- - // -------- GenericView Template Data ---------- const String kViewEmptyTemplateGenericViewPath = @@ -3369,7 +3280,6 @@ class {{viewName}} extends StackedView<{{viewModelName}}> { // -------------------------------------------------- - // -------- GenericViewV1 Template Data ---------- const String kViewEmptyTemplateGenericViewV1Path = @@ -3401,7 +3311,6 @@ class {{viewName}} extends StatelessWidget { // -------------------------------------------------- - // -------- GenericViewmodelTest Template Data ---------- const String kViewWebTemplateGenericViewmodelTestPath = @@ -3424,7 +3333,6 @@ void main() { // -------------------------------------------------- - // -------- GenericViewmodel Template Data ---------- const String kViewWebTemplateGenericViewmodelPath = @@ -3439,7 +3347,6 @@ class {{viewModelName}} extends BaseViewModel { // -------------------------------------------------- - // -------- GenericViewMobile Template Data ---------- const String kViewWebTemplateGenericViewMobilePath = @@ -3474,7 +3381,6 @@ class {{viewName}}Mobile extends ViewModelWidget<{{viewModelName}}> { // -------------------------------------------------- - // -------- GenericViewTablet Template Data ---------- const String kViewWebTemplateGenericViewTabletPath = @@ -3509,7 +3415,6 @@ class {{viewName}}Tablet extends ViewModelWidget<{{viewModelName}}> { // -------------------------------------------------- - // -------- GenericView Template Data ---------- const String kViewWebTemplateGenericViewPath = @@ -3552,7 +3457,6 @@ class {{viewName}} extends StackedView<{{viewModelName}}> { // -------------------------------------------------- - // -------- GenericViewDesktop Template Data ---------- const String kViewWebTemplateGenericViewDesktopPath = @@ -3587,7 +3491,6 @@ class {{viewName}}Desktop extends ViewModelWidget<{{viewModelName}}> { // -------------------------------------------------- - // -------- GenericServiceTest Template Data ---------- const String kServiceEmptyTemplateGenericServiceTestPath = @@ -3610,7 +3513,6 @@ void main() { // -------------------------------------------------- - // -------- GenericService Template Data ---------- const String kServiceEmptyTemplateGenericServicePath = @@ -3624,7 +3526,6 @@ class {{serviceName}} { // -------------------------------------------------- - // -------- GenericSheetModelTest Template Data ---------- const String kBottomSheetEmptyTemplateGenericSheetModelTestPath = @@ -3647,7 +3548,6 @@ void main() { // -------------------------------------------------- - // -------- GenericSheetModel Template Data ---------- const String kBottomSheetEmptyTemplateGenericSheetModelPath = @@ -3662,7 +3562,6 @@ class {{sheetModelName}} extends BaseViewModel {} // -------------------------------------------------- - // -------- GenericSheetUseModel Template Data ---------- const String kBottomSheetEmptyTemplateGenericSheetUseModelPath = @@ -3733,7 +3632,6 @@ class {{sheetName}} extends StackedView<{{sheetModelName}}> { // -------------------------------------------------- - // -------- GenericSheet Template Data ---------- const String kBottomSheetEmptyTemplateGenericSheetPath = @@ -3792,4 +3690,3 @@ class {{sheetName}} extends StatelessWidget { '''; // -------------------------------------------------- - diff --git a/test/helpers/test_helpers.mocks.dart b/test/helpers/test_helpers.mocks.dart index 4d78623..18008b8 100644 --- a/test/helpers/test_helpers.mocks.dart +++ b/test/helpers/test_helpers.mocks.dart @@ -1377,6 +1377,17 @@ class MockAnalyticsService extends _i1.Mock implements _i17.AnalyticsService { returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); @override + _i6.Future deleteDialogEvent({required String? name}) => + (super.noSuchMethod( + Invocation.method( + #deleteDialogEvent, + [], + {#name: name}, + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + @override _i6.Future generateCodeEvent() => (super.noSuchMethod( Invocation.method( #generateCodeEvent,