diff --git a/lib/src/commands/create/create_widget_command.dart b/lib/src/commands/create/create_widget_command.dart index 8646be2..3164cd9 100644 --- a/lib/src/commands/create/create_widget_command.dart +++ b/lib/src/commands/create/create_widget_command.dart @@ -49,6 +49,11 @@ class CreateWidgetCommand extends Command with ProjectStructureValidator { abbr: 'c', help: kCommandHelpConfigFilePath, ) + ..addOption( + ksPath, + abbr: 'p', + help: kCommandHelpPath, + ) ..addFlag( ksModel, defaultsTo: true, @@ -64,10 +69,13 @@ class CreateWidgetCommand extends Command with ProjectStructureValidator { final workingDirectory = argResults!.rest.length > 1 ? argResults!.rest[1] : null; + // load configuration await _configService.composeAndLoadConfigFile( configFilePath: argResults![ksConfigPath], projectPath: workingDirectory, ); + // override [widgets_path] value on configuration + _configService.setWidgetsPath(argResults![ksPath]); _processService.formattingLineLength = argResults![ksLineLength]; await _pubspecService.initialise(workingDirectory: workingDirectory); diff --git a/lib/src/constants/command_constants.dart b/lib/src/constants/command_constants.dart index d243c75..8cc8793 100644 --- a/lib/src/constants/command_constants.dart +++ b/lib/src/constants/command_constants.dart @@ -29,6 +29,7 @@ const String ksAnalyze = 'analyze'; const String ksModel = 'model'; const String ksConfigPath = 'config-path'; const String ksWatch = 'watch'; +const String ksPath = 'path'; /// A list of strings that are used to run the run build_runner /// [build or watch] --delete-conflicting-outputs command. diff --git a/lib/src/constants/message_constants.dart b/lib/src/constants/message_constants.dart index d85e3b0..dea4201 100644 --- a/lib/src/constants/message_constants.dart +++ b/lib/src/constants/message_constants.dart @@ -47,6 +47,8 @@ const String kCommandHelpCreateAppTemplate = const String kCommandHelpConfigFilePath = 'Sets the file path for the custom config.'; +const String kCommandHelpPath = 'Sets the relative path for the component.'; + const String kCommandHelpCreateViewTemplate = 'Selects the type of view to create instead of the default empty view.'; diff --git a/lib/src/models/config_model.freezed.dart b/lib/src/models/config_model.freezed.dart index a05d728..8cbb522 100644 --- a/lib/src/models/config_model.freezed.dart +++ b/lib/src/models/config_model.freezed.dart @@ -112,27 +112,44 @@ abstract class $ConfigCopyWith<$Res> { _$ConfigCopyWithImpl<$Res, Config>; @useResult $Res call( - {@JsonKey(name: 'views_path') String viewsPath, - @JsonKey(name: 'services_path') String servicesPath, - @JsonKey(name: 'widgets_path') String widgetsPath, - @JsonKey(name: 'bottom_sheets_path') String bottomSheetsPath, + {@JsonKey(name: 'views_path') + String viewsPath, + @JsonKey(name: 'services_path') + String servicesPath, + @JsonKey(name: 'widgets_path') + String widgetsPath, + @JsonKey(name: 'bottom_sheets_path') + String bottomSheetsPath, @JsonKey(name: 'bottom_sheet_type_file_path') - String bottomSheetTypeFilePath, + String bottomSheetTypeFilePath, @JsonKey(name: 'bottom_sheet_builder_file_path') - String bottomSheetBuilderFilePath, - @JsonKey(name: 'dialogs_path') String dialogsPath, - @JsonKey(name: 'dialog_type_file_path') String dialogTypeFilePath, - @JsonKey(name: 'dialog_builder_file_path') String dialogBuilderFilePath, - @JsonKey(name: 'stacked_app_file_path') String stackedAppFilePath, - @JsonKey(name: 'test_helpers_file_path') String testHelpersFilePath, - @JsonKey(name: 'test_services_path') String testServicesPath, - @JsonKey(name: 'test_views_path') String testViewsPath, - @JsonKey(name: 'test_widgets_path') String testWidgetsPath, - @JsonKey(name: 'locator_name') String locatorName, - @JsonKey(name: 'register_mocks_function') String registerMocksFunction, - @JsonKey(name: 'v1') bool v1, - @JsonKey(name: 'line_length') int lineLength, - @JsonKey(name: 'prefer_web') bool preferWeb}); + String bottomSheetBuilderFilePath, + @JsonKey(name: 'dialogs_path') + String dialogsPath, + @JsonKey(name: 'dialog_type_file_path') + String dialogTypeFilePath, + @JsonKey(name: 'dialog_builder_file_path') + String dialogBuilderFilePath, + @JsonKey(name: 'stacked_app_file_path') + String stackedAppFilePath, + @JsonKey(name: 'test_helpers_file_path') + String testHelpersFilePath, + @JsonKey(name: 'test_services_path') + String testServicesPath, + @JsonKey(name: 'test_views_path') + String testViewsPath, + @JsonKey(name: 'test_widgets_path') + String testWidgetsPath, + @JsonKey(name: 'locator_name') + String locatorName, + @JsonKey(name: 'register_mocks_function') + String registerMocksFunction, + @JsonKey(name: 'v1') + bool v1, + @JsonKey(name: 'line_length') + int lineLength, + @JsonKey(name: 'prefer_web') + bool preferWeb}); } /// @nodoc @@ -256,27 +273,44 @@ abstract class _$$_ConfigCopyWith<$Res> implements $ConfigCopyWith<$Res> { @override @useResult $Res call( - {@JsonKey(name: 'views_path') String viewsPath, - @JsonKey(name: 'services_path') String servicesPath, - @JsonKey(name: 'widgets_path') String widgetsPath, - @JsonKey(name: 'bottom_sheets_path') String bottomSheetsPath, + {@JsonKey(name: 'views_path') + String viewsPath, + @JsonKey(name: 'services_path') + String servicesPath, + @JsonKey(name: 'widgets_path') + String widgetsPath, + @JsonKey(name: 'bottom_sheets_path') + String bottomSheetsPath, @JsonKey(name: 'bottom_sheet_type_file_path') - String bottomSheetTypeFilePath, + String bottomSheetTypeFilePath, @JsonKey(name: 'bottom_sheet_builder_file_path') - String bottomSheetBuilderFilePath, - @JsonKey(name: 'dialogs_path') String dialogsPath, - @JsonKey(name: 'dialog_type_file_path') String dialogTypeFilePath, - @JsonKey(name: 'dialog_builder_file_path') String dialogBuilderFilePath, - @JsonKey(name: 'stacked_app_file_path') String stackedAppFilePath, - @JsonKey(name: 'test_helpers_file_path') String testHelpersFilePath, - @JsonKey(name: 'test_services_path') String testServicesPath, - @JsonKey(name: 'test_views_path') String testViewsPath, - @JsonKey(name: 'test_widgets_path') String testWidgetsPath, - @JsonKey(name: 'locator_name') String locatorName, - @JsonKey(name: 'register_mocks_function') String registerMocksFunction, - @JsonKey(name: 'v1') bool v1, - @JsonKey(name: 'line_length') int lineLength, - @JsonKey(name: 'prefer_web') bool preferWeb}); + String bottomSheetBuilderFilePath, + @JsonKey(name: 'dialogs_path') + String dialogsPath, + @JsonKey(name: 'dialog_type_file_path') + String dialogTypeFilePath, + @JsonKey(name: 'dialog_builder_file_path') + String dialogBuilderFilePath, + @JsonKey(name: 'stacked_app_file_path') + String stackedAppFilePath, + @JsonKey(name: 'test_helpers_file_path') + String testHelpersFilePath, + @JsonKey(name: 'test_services_path') + String testServicesPath, + @JsonKey(name: 'test_views_path') + String testViewsPath, + @JsonKey(name: 'test_widgets_path') + String testWidgetsPath, + @JsonKey(name: 'locator_name') + String locatorName, + @JsonKey(name: 'register_mocks_function') + String registerMocksFunction, + @JsonKey(name: 'v1') + bool v1, + @JsonKey(name: 'line_length') + int lineLength, + @JsonKey(name: 'prefer_web') + bool preferWeb}); } /// @nodoc @@ -394,34 +428,44 @@ class __$$_ConfigCopyWithImpl<$Res> @JsonSerializable() class _$_Config implements _Config { _$_Config( - {@JsonKey(name: 'views_path') this.viewsPath = 'ui/views', - @JsonKey(name: 'services_path') this.servicesPath = 'services', - @JsonKey(name: 'widgets_path') this.widgetsPath = 'ui/widgets/common', + {@JsonKey(name: 'views_path') + this.viewsPath = 'ui/views', + @JsonKey(name: 'services_path') + this.servicesPath = 'services', + @JsonKey(name: 'widgets_path') + this.widgetsPath = 'ui/widgets/common', @JsonKey(name: 'bottom_sheets_path') - this.bottomSheetsPath = 'ui/bottom_sheets', + this.bottomSheetsPath = 'ui/bottom_sheets', @JsonKey(name: 'bottom_sheet_type_file_path') - this.bottomSheetTypeFilePath = 'enums/bottom_sheet_type.dart', + this.bottomSheetTypeFilePath = 'enums/bottom_sheet_type.dart', @JsonKey(name: 'bottom_sheet_builder_file_path') - this.bottomSheetBuilderFilePath = 'ui/setup/setup_bottom_sheet_ui.dart', - @JsonKey(name: 'dialogs_path') this.dialogsPath = 'ui/dialogs', + this.bottomSheetBuilderFilePath = 'ui/setup/setup_bottom_sheet_ui.dart', + @JsonKey(name: 'dialogs_path') + this.dialogsPath = 'ui/dialogs', @JsonKey(name: 'dialog_type_file_path') - this.dialogTypeFilePath = 'enums/dialog_type.dart', + this.dialogTypeFilePath = 'enums/dialog_type.dart', @JsonKey(name: 'dialog_builder_file_path') - this.dialogBuilderFilePath = 'ui/setup/setup_dialog_ui.dart', + this.dialogBuilderFilePath = 'ui/setup/setup_dialog_ui.dart', @JsonKey(name: 'stacked_app_file_path') - this.stackedAppFilePath = 'app/app.dart', + this.stackedAppFilePath = 'app/app.dart', @JsonKey(name: 'test_helpers_file_path') - this.testHelpersFilePath = 'helpers/test_helpers.dart', - @JsonKey(name: 'test_services_path') this.testServicesPath = 'services', - @JsonKey(name: 'test_views_path') this.testViewsPath = 'viewmodels', + this.testHelpersFilePath = 'helpers/test_helpers.dart', + @JsonKey(name: 'test_services_path') + this.testServicesPath = 'services', + @JsonKey(name: 'test_views_path') + this.testViewsPath = 'viewmodels', @JsonKey(name: 'test_widgets_path') - this.testWidgetsPath = 'widget_models', - @JsonKey(name: 'locator_name') this.locatorName = 'locator', + this.testWidgetsPath = 'widget_models', + @JsonKey(name: 'locator_name') + this.locatorName = 'locator', @JsonKey(name: 'register_mocks_function') - this.registerMocksFunction = 'registerServices', - @JsonKey(name: 'v1') this.v1 = false, - @JsonKey(name: 'line_length') this.lineLength = 80, - @JsonKey(name: 'prefer_web') this.preferWeb = false}); + this.registerMocksFunction = 'registerServices', + @JsonKey(name: 'v1') + this.v1 = false, + @JsonKey(name: 'line_length') + this.lineLength = 80, + @JsonKey(name: 'prefer_web') + this.preferWeb = false}); factory _$_Config.fromJson(Map json) => _$$_ConfigFromJson(json); @@ -619,29 +663,44 @@ class _$_Config implements _Config { abstract class _Config implements Config { factory _Config( - {@JsonKey(name: 'views_path') final String viewsPath, - @JsonKey(name: 'services_path') final String servicesPath, - @JsonKey(name: 'widgets_path') final String widgetsPath, - @JsonKey(name: 'bottom_sheets_path') final String bottomSheetsPath, + {@JsonKey(name: 'views_path') + final String viewsPath, + @JsonKey(name: 'services_path') + final String servicesPath, + @JsonKey(name: 'widgets_path') + final String widgetsPath, + @JsonKey(name: 'bottom_sheets_path') + final String bottomSheetsPath, @JsonKey(name: 'bottom_sheet_type_file_path') - final String bottomSheetTypeFilePath, + final String bottomSheetTypeFilePath, @JsonKey(name: 'bottom_sheet_builder_file_path') - final String bottomSheetBuilderFilePath, - @JsonKey(name: 'dialogs_path') final String dialogsPath, - @JsonKey(name: 'dialog_type_file_path') final String dialogTypeFilePath, + final String bottomSheetBuilderFilePath, + @JsonKey(name: 'dialogs_path') + final String dialogsPath, + @JsonKey(name: 'dialog_type_file_path') + final String dialogTypeFilePath, @JsonKey(name: 'dialog_builder_file_path') - final String dialogBuilderFilePath, - @JsonKey(name: 'stacked_app_file_path') final String stackedAppFilePath, - @JsonKey(name: 'test_helpers_file_path') final String testHelpersFilePath, - @JsonKey(name: 'test_services_path') final String testServicesPath, - @JsonKey(name: 'test_views_path') final String testViewsPath, - @JsonKey(name: 'test_widgets_path') final String testWidgetsPath, - @JsonKey(name: 'locator_name') final String locatorName, + final String dialogBuilderFilePath, + @JsonKey(name: 'stacked_app_file_path') + final String stackedAppFilePath, + @JsonKey(name: 'test_helpers_file_path') + final String testHelpersFilePath, + @JsonKey(name: 'test_services_path') + final String testServicesPath, + @JsonKey(name: 'test_views_path') + final String testViewsPath, + @JsonKey(name: 'test_widgets_path') + final String testWidgetsPath, + @JsonKey(name: 'locator_name') + final String locatorName, @JsonKey(name: 'register_mocks_function') - final String registerMocksFunction, - @JsonKey(name: 'v1') final bool v1, - @JsonKey(name: 'line_length') final int lineLength, - @JsonKey(name: 'prefer_web') final bool preferWeb}) = _$_Config; + final String registerMocksFunction, + @JsonKey(name: 'v1') + final bool v1, + @JsonKey(name: 'line_length') + final int lineLength, + @JsonKey(name: 'prefer_web') + final bool preferWeb}) = _$_Config; factory _Config.fromJson(Map json) = _$_Config.fromJson; diff --git a/lib/src/services/config_service.dart b/lib/src/services/config_service.dart index 3a59048..470dbb8 100644 --- a/lib/src/services/config_service.dart +++ b/lib/src/services/config_service.dart @@ -352,4 +352,11 @@ class ConfigService { String exportConfig() { return JsonEncoder.withIndent(" ").convert(_customConfig.toJson()); } + + /// Overrides [widgets_path] value on configuration. + void setWidgetsPath(String? path) { + _customConfig = _customConfig.copyWith( + widgetsPath: path ?? _customConfig.widgetsPath, + ); + } } 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 221fdca..277c9fa 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 = ''' { @@ -33,7 +31,6 @@ const String kAppWebTemplateStackedJsonStkContent = ''' // -------------------------------------------------- - // -------- UnknownViewmodelTest Template Data ---------- const String kAppWebTemplateUnknownViewmodelTestPath = @@ -55,7 +52,6 @@ void main() { // -------------------------------------------------- - // -------- HomeViewmodelTest Template Data ---------- const String kAppWebTemplateHomeViewmodelTestPath = @@ -107,7 +103,6 @@ void main() { // -------------------------------------------------- - // -------- NoticeSheetModelTest Template Data ---------- const String kAppWebTemplateNoticeSheetModelTestPath = @@ -130,7 +125,6 @@ void main() { // -------------------------------------------------- - // -------- InfoAlertDialogModelTest Template Data ---------- const String kAppWebTemplateInfoAlertDialogModelTestPath = @@ -153,7 +147,6 @@ void main() { // -------------------------------------------------- - // -------- TestHelpers Template Data ---------- const String kAppWebTemplateTestHelpersPath = @@ -243,11 +236,9 @@ void _removeRegistrationIfExists() { // -------------------------------------------------- - // -------- BuildYamlStk Template Data ---------- -const String kAppWebTemplateBuildYamlStkPath = - 'build.yaml.stk'; +const String kAppWebTemplateBuildYamlStkPath = 'build.yaml.stk'; const String kAppWebTemplateBuildYamlStkContent = ''' targets: @@ -260,11 +251,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 @@ -272,11 +261,9 @@ iVBORw0KGgoAAAANSUhEUgAAALMAAACzCAYAAADCFC3zAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNS // -------------------------------------------------- - // -------- IndexHtmlStk Template Data ---------- -const String kAppWebTemplateIndexHtmlStkPath = - 'web/index.html.stk'; +const String kAppWebTemplateIndexHtmlStkPath = 'web/index.html.stk'; const String kAppWebTemplateIndexHtmlStkContent = ''' @@ -454,11 +441,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= @@ -466,11 +451,9 @@ iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNS // -------------------------------------------------- - // -------- READMEMdStk Template Data ---------- -const String kAppWebTemplateREADMEMdStkPath = - 'README.md.stk'; +const String kAppWebTemplateREADMEMdStkPath = 'README.md.stk'; const String kAppWebTemplateREADMEMdStkContent = ''' # stacked_app @@ -494,11 +477,9 @@ samples, guidance on mobile development, and a full API reference. // -------------------------------------------------- - // -------- 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'; @@ -551,7 +532,6 @@ class MyApp extends StatelessWidget { // -------------------------------------------------- - // -------- AppConstants Template Data ---------- const String kAppWebTemplateAppConstantsPath = @@ -568,11 +548,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'; @@ -658,7 +636,6 @@ double getResponsiveFontSize(BuildContext context, // -------------------------------------------------- - // -------- AppStrings Template Data ---------- const String kAppWebTemplateAppStringsPath = @@ -673,11 +650,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'; @@ -696,7 +671,6 @@ const Color kcBackgroundColor = kcDarkGreyColor; // -------------------------------------------------- - // -------- NoticeSheetModel Template Data ---------- const String kAppWebTemplateNoticeSheetModelPath = @@ -711,7 +685,6 @@ class NoticeSheetModel extends BaseViewModel {} // -------------------------------------------------- - // -------- NoticeSheet Template Data ---------- const String kAppWebTemplateNoticeSheetPath = @@ -780,7 +753,6 @@ class NoticeSheet extends StackedView { // -------------------------------------------------- - // -------- InfoAlertDialogModel Template Data ---------- const String kAppWebTemplateInfoAlertDialogModelPath = @@ -795,7 +767,6 @@ class InfoAlertDialogModel extends BaseViewModel {} // -------------------------------------------------- - // -------- InfoAlertDialog Template Data ---------- const String kAppWebTemplateInfoAlertDialogPath = @@ -915,7 +886,6 @@ class InfoAlertDialog extends StackedView { // -------------------------------------------------- - // -------- HomeViewDesktop Template Data ---------- const String kAppWebTemplateHomeViewDesktopPath = @@ -1002,7 +972,6 @@ class HomeViewDesktop extends ViewModelWidget { // -------------------------------------------------- - // -------- HomeViewMobile Template Data ---------- const String kAppWebTemplateHomeViewMobilePath = @@ -1089,7 +1058,6 @@ class HomeViewMobile extends ViewModelWidget { // -------------------------------------------------- - // -------- HomeView Template Data ---------- const String kAppWebTemplateHomeViewPath = @@ -1132,7 +1100,6 @@ class HomeView extends StackedView { // -------------------------------------------------- - // -------- HomeViewmodel Template Data ---------- const String kAppWebTemplateHomeViewmodelPath = @@ -1180,7 +1147,6 @@ class HomeViewModel extends BaseViewModel { // -------------------------------------------------- - // -------- HomeViewTablet Template Data ---------- const String kAppWebTemplateHomeViewTabletPath = @@ -1267,7 +1233,6 @@ class HomeViewTablet extends ViewModelWidget { // -------------------------------------------------- - // -------- UnknownView Template Data ---------- const String kAppWebTemplateUnknownViewPath = @@ -1310,7 +1275,6 @@ class UnknownView extends StackedView { // -------------------------------------------------- - // -------- UnknownViewDesktop Template Data ---------- const String kAppWebTemplateUnknownViewDesktopPath = @@ -1366,7 +1330,6 @@ class UnknownViewDesktop extends ViewModelWidget { // -------------------------------------------------- - // -------- UnknownViewTablet Template Data ---------- const String kAppWebTemplateUnknownViewTabletPath = @@ -1422,7 +1385,6 @@ class UnknownViewTablet extends ViewModelWidget { // -------------------------------------------------- - // -------- UnknownViewmodel Template Data ---------- const String kAppWebTemplateUnknownViewmodelPath = @@ -1437,7 +1399,6 @@ class UnknownViewModel extends BaseViewModel {} // -------------------------------------------------- - // -------- UnknownViewMobile Template Data ---------- const String kAppWebTemplateUnknownViewMobilePath = @@ -1492,7 +1453,6 @@ class UnknownViewMobile extends ViewModelWidget { // -------------------------------------------------- - // -------- StartupViewmodel Template Data ---------- const String kAppWebTemplateStartupViewmodelPath = @@ -1520,7 +1480,6 @@ class StartupViewModel extends BaseViewModel { // -------------------------------------------------- - // -------- StartupView Template Data ---------- const String kAppWebTemplateStartupViewPath = @@ -1587,7 +1546,6 @@ class StartupView extends StackedView { // -------------------------------------------------- - // -------- ScaleOnHover Template Data ---------- const String kAppWebTemplateScaleOnHoverPath = @@ -1637,7 +1595,6 @@ class _ScaleOnHoverState extends State { // -------------------------------------------------- - // -------- TranslateOnHover Template Data ---------- const String kAppWebTemplateTranslateOnHoverPath = @@ -1694,11 +1651,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'; @@ -1742,7 +1697,6 @@ class App {} // -------------------------------------------------- - // -------- HoverExtensions Template Data ---------- const String kAppWebTemplateHoverExtensionsPath = @@ -1797,11 +1751,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}} @@ -1908,11 +1860,9 @@ flutter: // -------------------------------------------------- - // -------- SettingsJsonStk Template Data ---------- -const String kAppWebTemplateSettingsJsonStkPath = - '.vscode/settings.json.stk'; +const String kAppWebTemplateSettingsJsonStkPath = '.vscode/settings.json.stk'; const String kAppWebTemplateSettingsJsonStkContent = ''' { @@ -1926,11 +1876,9 @@ const String kAppWebTemplateSettingsJsonStkContent = ''' // -------------------------------------------------- - // -------- StackedJsonStk Template Data ---------- -const String kAppMobileTemplateStackedJsonStkPath = - 'stacked.json.stk'; +const String kAppMobileTemplateStackedJsonStkPath = 'stacked.json.stk'; const String kAppMobileTemplateStackedJsonStkContent = ''' { @@ -1958,7 +1906,6 @@ const String kAppMobileTemplateStackedJsonStkContent = ''' // -------------------------------------------------- - // -------- HomeViewmodelTest Template Data ---------- const String kAppMobileTemplateHomeViewmodelTestPath = @@ -2010,7 +1957,6 @@ void main() { // -------------------------------------------------- - // -------- NoticeSheetModelTest Template Data ---------- const String kAppMobileTemplateNoticeSheetModelTestPath = @@ -2033,7 +1979,6 @@ void main() { // -------------------------------------------------- - // -------- InfoAlertDialogModelTest Template Data ---------- const String kAppMobileTemplateInfoAlertDialogModelTestPath = @@ -2056,7 +2001,6 @@ void main() { // -------------------------------------------------- - // -------- TestHelpers Template Data ---------- const String kAppMobileTemplateTestHelpersPath = @@ -2146,11 +2090,9 @@ void _removeRegistrationIfExists() { // -------------------------------------------------- - // -------- READMEMdStk Template Data ---------- -const String kAppMobileTemplateREADMEMdStkPath = - 'README.md.stk'; +const String kAppMobileTemplateREADMEMdStkPath = 'README.md.stk'; const String kAppMobileTemplateREADMEMdStkContent = ''' # stacked_app @@ -2174,11 +2116,9 @@ samples, guidance on mobile development, and a full API reference. // -------------------------------------------------- - // -------- 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'; @@ -2225,7 +2165,6 @@ class MyApp extends StatelessWidget { // -------------------------------------------------- - // -------- UiHelpers Template Data ---------- const String kAppMobileTemplateUiHelpersPath = @@ -2315,7 +2254,6 @@ double getResponsiveFontSize(BuildContext context, // -------------------------------------------------- - // -------- AppStrings Template Data ---------- const String kAppMobileTemplateAppStringsPath = @@ -2330,7 +2268,6 @@ const String ksHomeBottomSheetDescription = // -------------------------------------------------- - // -------- AppColors Template Data ---------- const String kAppMobileTemplateAppColorsPath = @@ -2351,7 +2288,6 @@ const Color kcBackgroundColor = kcDarkGreyColor; // -------------------------------------------------- - // -------- NoticeSheetModel Template Data ---------- const String kAppMobileTemplateNoticeSheetModelPath = @@ -2366,7 +2302,6 @@ class NoticeSheetModel extends BaseViewModel {} // -------------------------------------------------- - // -------- NoticeSheet Template Data ---------- const String kAppMobileTemplateNoticeSheetPath = @@ -2435,7 +2370,6 @@ class NoticeSheet extends StackedView { // -------------------------------------------------- - // -------- InfoAlertDialogModel Template Data ---------- const String kAppMobileTemplateInfoAlertDialogModelPath = @@ -2450,7 +2384,6 @@ class InfoAlertDialogModel extends BaseViewModel {} // -------------------------------------------------- - // -------- InfoAlertDialog Template Data ---------- const String kAppMobileTemplateInfoAlertDialogPath = @@ -2570,7 +2503,6 @@ class InfoAlertDialog extends StackedView { // -------------------------------------------------- - // -------- HomeViewV1 Template Data ---------- const String kAppMobileTemplateHomeViewV1Path = @@ -2659,7 +2591,6 @@ class HomeView extends StatelessWidget { // -------------------------------------------------- - // -------- HomeView Template Data ---------- const String kAppMobileTemplateHomeViewPath = @@ -2755,7 +2686,6 @@ class HomeView extends StackedView { // -------------------------------------------------- - // -------- HomeViewmodel Template Data ---------- const String kAppMobileTemplateHomeViewmodelPath = @@ -2803,7 +2733,6 @@ class HomeViewModel extends BaseViewModel { // -------------------------------------------------- - // -------- StartupViewmodel Template Data ---------- const String kAppMobileTemplateStartupViewmodelPath = @@ -2833,7 +2762,6 @@ class StartupViewModel extends BaseViewModel { // -------------------------------------------------- - // -------- StartupViewV1 Template Data ---------- const String kAppMobileTemplateStartupViewV1Path = @@ -2899,7 +2827,6 @@ class StartupView extends StatelessWidget { // -------------------------------------------------- - // -------- StartupView Template Data ---------- const String kAppMobileTemplateStartupViewPath = @@ -2966,11 +2893,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'; @@ -3008,11 +2933,9 @@ class App {} // -------------------------------------------------- - // -------- PubspecYamlStk Template Data ---------- -const String kAppMobileTemplatePubspecYamlStkPath = - 'pubspec.yaml.stk'; +const String kAppMobileTemplatePubspecYamlStkPath = 'pubspec.yaml.stk'; const String kAppMobileTemplatePubspecYamlStkContent = ''' name: {{packageName}} @@ -3116,7 +3039,6 @@ flutter: // -------------------------------------------------- - // -------- SettingsJsonStk Template Data ---------- const String kAppMobileTemplateSettingsJsonStkPath = @@ -3134,7 +3056,6 @@ const String kAppMobileTemplateSettingsJsonStkContent = ''' // -------------------------------------------------- - // -------- GenericModelTest Template Data ---------- const String kWidgetEmptyTemplateGenericModelTestPath = @@ -3157,7 +3078,6 @@ void main() { // -------------------------------------------------- - // -------- GenericUseModel Template Data ---------- const String kWidgetEmptyTemplateGenericUseModelPath = @@ -3190,7 +3110,6 @@ class {{widgetName}} extends StackedView<{{widgetModelName}}> { // -------------------------------------------------- - // -------- Generic Template Data ---------- const String kWidgetEmptyTemplateGenericPath = @@ -3212,7 +3131,6 @@ class {{widgetName}} extends StatelessWidget { // -------------------------------------------------- - // -------- GenericModel Template Data ---------- const String kWidgetEmptyTemplateGenericModelPath = @@ -3226,7 +3144,6 @@ class {{widgetModelName}} extends BaseViewModel {} // -------------------------------------------------- - // -------- GenericDialogModelTest Template Data ---------- const String kDialogEmptyTemplateGenericDialogModelTestPath = @@ -3249,7 +3166,6 @@ void main() { // -------------------------------------------------- - // -------- GenericDialogModel Template Data ---------- const String kDialogEmptyTemplateGenericDialogModelPath = @@ -3264,7 +3180,6 @@ class {{dialogModelName}} extends BaseViewModel {} // -------------------------------------------------- - // -------- GenericDialogUseModel Template Data ---------- const String kDialogEmptyTemplateGenericDialogUseModelPath = @@ -3385,7 +3300,6 @@ class {{dialogName}} extends StackedView<{{dialogModelName}}> { // -------------------------------------------------- - // -------- GenericDialog Template Data ---------- const String kDialogEmptyTemplateGenericDialogPath = @@ -3495,7 +3409,6 @@ class {{dialogName}} extends StatelessWidget { // -------------------------------------------------- - // -------- GenericViewmodelTest Template Data ---------- const String kViewEmptyTemplateGenericViewmodelTestPath = @@ -3518,7 +3431,6 @@ void main() { // -------------------------------------------------- - // -------- GenericViewmodel Template Data ---------- const String kViewEmptyTemplateGenericViewmodelPath = @@ -3532,7 +3444,6 @@ class {{viewModelName}} extends BaseViewModel {} // -------------------------------------------------- - // -------- GenericView Template Data ---------- const String kViewEmptyTemplateGenericViewPath = @@ -3570,7 +3481,6 @@ class {{viewName}} extends StackedView<{{viewModelName}}> { // -------------------------------------------------- - // -------- GenericViewV1 Template Data ---------- const String kViewEmptyTemplateGenericViewV1Path = @@ -3602,7 +3512,6 @@ class {{viewName}} extends StatelessWidget { // -------------------------------------------------- - // -------- GenericViewmodelTest Template Data ---------- const String kViewWebTemplateGenericViewmodelTestPath = @@ -3625,7 +3534,6 @@ void main() { // -------------------------------------------------- - // -------- GenericViewmodel Template Data ---------- const String kViewWebTemplateGenericViewmodelPath = @@ -3640,7 +3548,6 @@ class {{viewModelName}} extends BaseViewModel { // -------------------------------------------------- - // -------- GenericViewMobile Template Data ---------- const String kViewWebTemplateGenericViewMobilePath = @@ -3675,7 +3582,6 @@ class {{viewName}}Mobile extends ViewModelWidget<{{viewModelName}}> { // -------------------------------------------------- - // -------- GenericViewTablet Template Data ---------- const String kViewWebTemplateGenericViewTabletPath = @@ -3710,7 +3616,6 @@ class {{viewName}}Tablet extends ViewModelWidget<{{viewModelName}}> { // -------------------------------------------------- - // -------- GenericView Template Data ---------- const String kViewWebTemplateGenericViewPath = @@ -3753,7 +3658,6 @@ class {{viewName}} extends StackedView<{{viewModelName}}> { // -------------------------------------------------- - // -------- GenericViewDesktop Template Data ---------- const String kViewWebTemplateGenericViewDesktopPath = @@ -3788,7 +3692,6 @@ class {{viewName}}Desktop extends ViewModelWidget<{{viewModelName}}> { // -------------------------------------------------- - // -------- GenericServiceTest Template Data ---------- const String kServiceEmptyTemplateGenericServiceTestPath = @@ -3811,7 +3714,6 @@ void main() { // -------------------------------------------------- - // -------- GenericService Template Data ---------- const String kServiceEmptyTemplateGenericServicePath = @@ -3825,7 +3727,6 @@ class {{serviceName}} { // -------------------------------------------------- - // -------- GenericSheetModelTest Template Data ---------- const String kBottomSheetEmptyTemplateGenericSheetModelTestPath = @@ -3848,7 +3749,6 @@ void main() { // -------------------------------------------------- - // -------- GenericSheetModel Template Data ---------- const String kBottomSheetEmptyTemplateGenericSheetModelPath = @@ -3863,7 +3763,6 @@ class {{sheetModelName}} extends BaseViewModel {} // -------------------------------------------------- - // -------- GenericSheetUseModel Template Data ---------- const String kBottomSheetEmptyTemplateGenericSheetUseModelPath = @@ -3934,7 +3833,6 @@ class {{sheetName}} extends StackedView<{{sheetModelName}}> { // -------------------------------------------------- - // -------- GenericSheet Template Data ---------- const String kBottomSheetEmptyTemplateGenericSheetPath = @@ -3993,4 +3891,3 @@ class {{sheetName}} extends StatelessWidget { '''; // -------------------------------------------------- - diff --git a/pubspec.yaml b/pubspec.yaml index 541d4c2..93c2d58 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -8,27 +8,27 @@ environment: sdk: ">=2.17.0 <3.0.0" dependencies: - args: ^2.3.0 + args: ^2.4.1 freezed_annotation: ^2.1.0 - get_it: ^7.2.0 - mockito: ^5.0.17 + get_it: ^7.6.0 + mockito: ^5.4.1 mustache_template: ^2.0.0 path: ^1.8.1 pubspec_yaml: ^3.1.0 recase: ^4.0.0 - json_annotation: ^4.7.0 + json_annotation: ^4.8.1 ansicolor: ^2.0.1 xdg_directories: ^1.0.0 - usage: ^4.1.0 + usage: ^4.1.1 pub_updater: ^0.3.0 dev_dependencies: lints: ^2.0.0 test: ^1.16.0 - build_runner: ^2.2.0 - freezed: ^2.1.0+1 - json_serializable: ^6.3.1 + build_runner: ^2.4.4 + freezed: ^2.3.4 + json_serializable: ^6.7.0 executables: stacked: diff --git a/test/helpers/test_helpers.mocks.dart b/test/helpers/test_helpers.mocks.dart index feefa8a..b79178c 100644 --- a/test/helpers/test_helpers.mocks.dart +++ b/test/helpers/test_helpers.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.0 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in stacked_cli/test/helpers/test_helpers.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i6; import 'dart:io' as _i2; @@ -1121,6 +1123,14 @@ class MockConfigService extends _i1.Mock implements _i15.ConfigService { returnValue: '', returnValueForMissingStub: '', ) as String); + @override + void setWidgetsPath(String? path) => super.noSuchMethod( + Invocation.method( + #setWidgetsPath, + [path], + ), + returnValueForMissingStub: null, + ); } /// A class which mocks [ProcessService].