diff --git a/CHANGELOG.md b/CHANGELOG.md index eae2e6d..670b3ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## [Unreleased] + +### Features + +* **create commands:** Add --no-test flag to skip test file generation ([#XX](https://github.com/Stacked-Org/stacked/issues/1097)) + - Added --no-test flag to all create commands (view, service, bottom_sheet, dialog, widget) + - When provided, no test files will be generated for the created components + - Maintains backward compatibility with default behavior unchanged + - Fixed for-loop bug in CreateWidgetCommand + # [1.14.0](https://github.com/Stacked-Org/cli/compare/v1.13.4...v1.14.0) (2025-02-18) diff --git a/lib/src/commands/create/create_bottom_sheet_command.dart b/lib/src/commands/create/create_bottom_sheet_command.dart index 688a3d4..05018ff 100644 --- a/lib/src/commands/create/create_bottom_sheet_command.dart +++ b/lib/src/commands/create/create_bottom_sheet_command.dart @@ -62,6 +62,11 @@ class CreateBottomSheetCommand extends Command with ProjectStructureValidator { ..addOption( ksProjectPath, help: kCommandHelpProjectPath, + ) + ..addFlag( + ksNoTest, + defaultsTo: false, + help: kCommandHelpNoTest, ); } @@ -88,6 +93,7 @@ class CreateBottomSheetCommand extends Command with ProjectStructureValidator { excludeRoute: argResults![ksExcludeRoute], hasModel: argResults![ksModel], templateType: templateType, + noTest: argResults![ksNoTest], ); await _analyticsService.createBottomSheetEvent( diff --git a/lib/src/commands/create/create_dialog_command.dart b/lib/src/commands/create/create_dialog_command.dart index e62081a..5d7b8f2 100644 --- a/lib/src/commands/create/create_dialog_command.dart +++ b/lib/src/commands/create/create_dialog_command.dart @@ -62,6 +62,11 @@ class CreateDialogCommand extends Command with ProjectStructureValidator { ..addOption( ksProjectPath, help: kCommandHelpProjectPath, + ) + ..addFlag( + ksNoTest, + defaultsTo: false, + help: kCommandHelpNoTest, ); } @@ -88,6 +93,7 @@ class CreateDialogCommand extends Command with ProjectStructureValidator { excludeRoute: argResults![ksExcludeRoute], hasModel: argResults![ksModel], templateType: templateType, + noTest: argResults![ksNoTest], ); await _analyticsService.createDialogEvent( diff --git a/lib/src/commands/create/create_service_command.dart b/lib/src/commands/create/create_service_command.dart index 48b69c8..283068f 100644 --- a/lib/src/commands/create/create_service_command.dart +++ b/lib/src/commands/create/create_service_command.dart @@ -57,6 +57,11 @@ class CreateServiceCommand extends Command with ProjectStructureValidator { ..addOption( ksProjectPath, help: kCommandHelpProjectPath, + ) + ..addFlag( + ksNoTest, + defaultsTo: false, + help: kCommandHelpNoTest, ); } @@ -82,6 +87,7 @@ class CreateServiceCommand extends Command with ProjectStructureValidator { verbose: true, excludeRoute: argResults![ksExcludeDependency], templateType: templateType, + noTest: argResults![ksNoTest], ); await _analyticsService.createServiceEvent( diff --git a/lib/src/commands/create/create_view_command.dart b/lib/src/commands/create/create_view_command.dart index 88d208f..fda4226 100644 --- a/lib/src/commands/create/create_view_command.dart +++ b/lib/src/commands/create/create_view_command.dart @@ -62,6 +62,11 @@ class CreateViewCommand extends Command with ProjectStructureValidator { ..addOption( ksProjectPath, help: kCommandHelpProjectPath, + ) + ..addFlag( + ksNoTest, + defaultsTo: false, + help: kCommandHelpNoTest, ); } @@ -96,6 +101,7 @@ class CreateViewCommand extends Command with ProjectStructureValidator { excludeRoute: argResults![ksExcludeRoute], useBuilder: argResults![ksV1] ?? _configService.v1, templateType: templateType, + noTest: argResults![ksNoTest], ); await _analyticsService.createViewEvent( diff --git a/lib/src/commands/create/create_widget_command.dart b/lib/src/commands/create/create_widget_command.dart index 8c92128..6a1f792 100644 --- a/lib/src/commands/create/create_widget_command.dart +++ b/lib/src/commands/create/create_widget_command.dart @@ -61,6 +61,11 @@ class CreateWidgetCommand extends Command with ProjectStructureValidator { ..addOption( ksProjectPath, help: kCommandHelpProjectPath, + ) + ..addFlag( + ksNoTest, + defaultsTo: false, + help: kCommandHelpNoTest, ); } @@ -82,7 +87,7 @@ class CreateWidgetCommand extends Command with ProjectStructureValidator { workingDirectory: argResults![ksProjectPath]); await validateStructure(outputPath: argResults![ksProjectPath]); - for (var i = 0; i < widgetNames.length; i) { + for (var i = 0; i < widgetNames.length; i++) { await _templateService.renderTemplate( templateName: name, name: widgetNames[i], @@ -90,6 +95,7 @@ class CreateWidgetCommand extends Command with ProjectStructureValidator { verbose: true, hasModel: argResults![ksModel], templateType: templateType, + noTest: argResults![ksNoTest], ); await _analyticsService.createWidgetEvent( diff --git a/lib/src/constants/command_constants.dart b/lib/src/constants/command_constants.dart index 808a198..a1716f6 100644 --- a/lib/src/constants/command_constants.dart +++ b/lib/src/constants/command_constants.dart @@ -36,6 +36,7 @@ const String ksAppDescription = 'description'; const String ksAppOrganization = 'org'; const String ksAppPlatforms = 'platforms'; const String ksProjectPath = 'project-path'; +const String ksNoTest = 'no-test'; /// 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 24dd48a..88dc2df 100644 --- a/lib/src/constants/message_constants.dart +++ b/lib/src/constants/message_constants.dart @@ -106,3 +106,6 @@ Paths on Stacked config do not need to start with directory "lib" or "test" beca const String kCommandHelpProjectPath = ''' When path is provided, it will be considered the project directory instead of the current directory. '''; + +const String kCommandHelpNoTest = + 'When provided, no test files will be generated for the created component.'; diff --git a/lib/src/models/config_model.freezed.dart b/lib/src/models/config_model.freezed.dart index a05d728..b6fe195 100644 --- a/lib/src/models/config_model.freezed.dart +++ b/lib/src/models/config_model.freezed.dart @@ -12,7 +12,7 @@ part of 'config_model.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); Config _$ConfigFromJson(Map json) { return _Config.fromJson(json); @@ -101,8 +101,12 @@ mixin _$Config { @JsonKey(name: 'prefer_web') bool get preferWeb => throw _privateConstructorUsedError; + /// Serializes this Config to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Config + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ConfigCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -145,6 +149,8 @@ class _$ConfigCopyWithImpl<$Res, $Val extends Config> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Config + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -250,9 +256,10 @@ class _$ConfigCopyWithImpl<$Res, $Val extends Config> } /// @nodoc -abstract class _$$_ConfigCopyWith<$Res> implements $ConfigCopyWith<$Res> { - factory _$$_ConfigCopyWith(_$_Config value, $Res Function(_$_Config) then) = - __$$_ConfigCopyWithImpl<$Res>; +abstract class _$$ConfigImplCopyWith<$Res> implements $ConfigCopyWith<$Res> { + factory _$$ConfigImplCopyWith( + _$ConfigImpl value, $Res Function(_$ConfigImpl) then) = + __$$ConfigImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -280,12 +287,15 @@ abstract class _$$_ConfigCopyWith<$Res> implements $ConfigCopyWith<$Res> { } /// @nodoc -class __$$_ConfigCopyWithImpl<$Res> - extends _$ConfigCopyWithImpl<$Res, _$_Config> - implements _$$_ConfigCopyWith<$Res> { - __$$_ConfigCopyWithImpl(_$_Config _value, $Res Function(_$_Config) _then) +class __$$ConfigImplCopyWithImpl<$Res> + extends _$ConfigCopyWithImpl<$Res, _$ConfigImpl> + implements _$$ConfigImplCopyWith<$Res> { + __$$ConfigImplCopyWithImpl( + _$ConfigImpl _value, $Res Function(_$ConfigImpl) _then) : super(_value, _then); + /// Create a copy of Config + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -309,7 +319,7 @@ class __$$_ConfigCopyWithImpl<$Res> Object? lineLength = null, Object? preferWeb = null, }) { - return _then(_$_Config( + return _then(_$ConfigImpl( viewsPath: null == viewsPath ? _value.viewsPath : viewsPath // ignore: cast_nullable_to_non_nullable @@ -392,8 +402,8 @@ class __$$_ConfigCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_Config implements _Config { - _$_Config( +class _$ConfigImpl implements _Config { + _$ConfigImpl( {@JsonKey(name: 'views_path') this.viewsPath = 'ui/views', @JsonKey(name: 'services_path') this.servicesPath = 'services', @JsonKey(name: 'widgets_path') this.widgetsPath = 'ui/widgets/common', @@ -423,8 +433,8 @@ class _$_Config implements _Config { @JsonKey(name: 'line_length') this.lineLength = 80, @JsonKey(name: 'prefer_web') this.preferWeb = false}); - factory _$_Config.fromJson(Map json) => - _$$_ConfigFromJson(json); + factory _$ConfigImpl.fromJson(Map json) => + _$$ConfigImplFromJson(json); /// Path where views and viewmodels will be genereated. @override @@ -532,10 +542,10 @@ class _$_Config implements _Config { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_Config && + other is _$ConfigImpl && (identical(other.viewsPath, viewsPath) || other.viewsPath == viewsPath) && (identical(other.servicesPath, servicesPath) || @@ -578,7 +588,7 @@ class _$_Config implements _Config { other.preferWeb == preferWeb)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hashAll([ runtimeType, @@ -603,15 +613,17 @@ class _$_Config implements _Config { preferWeb ]); - @JsonKey(ignore: true) + /// Create a copy of Config + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$_ConfigCopyWith<_$_Config> get copyWith => - __$$_ConfigCopyWithImpl<_$_Config>(this, _$identity); + _$$ConfigImplCopyWith<_$ConfigImpl> get copyWith => + __$$ConfigImplCopyWithImpl<_$ConfigImpl>(this, _$identity); @override Map toJson() { - return _$$_ConfigToJson( + return _$$ConfigImplToJson( this, ); } @@ -641,112 +653,114 @@ abstract class _Config implements 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; + @JsonKey(name: 'prefer_web') final bool preferWeb}) = _$ConfigImpl; - @override + factory _Config.fromJson(Map json) = _$ConfigImpl.fromJson; /// Path where views and viewmodels will be genereated. + @override @JsonKey(name: 'views_path') String get viewsPath; - @override /// Path where services will be genereated. + @override @JsonKey(name: 'services_path') String get servicesPath; - @override /// Path where widgets will be genereated. + @override @JsonKey(name: 'widgets_path') String get widgetsPath; - @override /// Path where bottom sheets will be genereated. + @override @JsonKey(name: 'bottom_sheets_path') String get bottomSheetsPath; - @override /// File path where BottomSheetType enum values are located. + @override @JsonKey(name: 'bottom_sheet_type_file_path') String get bottomSheetTypeFilePath; - @override /// File path where BottomSheet builders are located. + @override @JsonKey(name: 'bottom_sheet_builder_file_path') String get bottomSheetBuilderFilePath; - @override /// Path where dialogs will be genereated. + @override @JsonKey(name: 'dialogs_path') String get dialogsPath; - @override /// File path where DialogType enum values are located. + @override @JsonKey(name: 'dialog_type_file_path') String get dialogTypeFilePath; - @override /// File path where Dialog builders are located. + @override @JsonKey(name: 'dialog_builder_file_path') String get dialogBuilderFilePath; - @override /// File path where StackedApp is setup. + @override @JsonKey(name: 'stacked_app_file_path') String get stackedAppFilePath; - @override /// File path where register functions for unit test setup and mock /// declarations are located. + @override @JsonKey(name: 'test_helpers_file_path') String get testHelpersFilePath; - @override /// Paths where services unit tests will be genereated. + @override @JsonKey(name: 'test_services_path') String get testServicesPath; - @override /// Path where viewmodels unit tests will be genereated. + @override @JsonKey(name: 'test_views_path') String get testViewsPath; - @override /// Path where widget models unit tests will be genereated. + @override @JsonKey(name: 'test_widgets_path') String get testWidgetsPath; - @override /// The name of the locator to use when registering test mocks + @override @JsonKey(name: 'locator_name') String get locatorName; - @override /// The name of the function that registers the mock services for tests. /// /// This is used when creating a test file during the `create service` command + @override @JsonKey(name: 'register_mocks_function') String get registerMocksFunction; - @override /// Boolean value to determine view builder style /// /// This is used when creating a view file during `create view` command. By /// default, StackedView is used. + @override @JsonKey(name: 'v1') bool get v1; - @override /// Defines the integer value to determine the line length when formatting /// the code. + @override @JsonKey(name: 'line_length') int get lineLength; @override @JsonKey(name: 'prefer_web') bool get preferWeb; + + /// Create a copy of Config + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) - _$$_ConfigCopyWith<_$_Config> get copyWith => + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ConfigImplCopyWith<_$ConfigImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/models/config_model.g.dart b/lib/src/models/config_model.g.dart index e1a5b00..eb99440 100644 --- a/lib/src/models/config_model.g.dart +++ b/lib/src/models/config_model.g.dart @@ -6,7 +6,7 @@ part of 'config_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$_Config _$$_ConfigFromJson(Map json) => _$_Config( +_$ConfigImpl _$$ConfigImplFromJson(Map json) => _$ConfigImpl( viewsPath: json['views_path'] as String? ?? 'ui/views', servicesPath: json['services_path'] as String? ?? 'services', widgetsPath: json['widgets_path'] as String? ?? 'ui/widgets/common', @@ -33,11 +33,12 @@ _$_Config _$$_ConfigFromJson(Map json) => _$_Config( registerMocksFunction: json['register_mocks_function'] as String? ?? 'registerServices', v1: json['v1'] as bool? ?? false, - lineLength: json['line_length'] as int? ?? 80, + lineLength: (json['line_length'] as num?)?.toInt() ?? 80, preferWeb: json['prefer_web'] as bool? ?? false, ); -Map _$$_ConfigToJson(_$_Config instance) => { +Map _$$ConfigImplToJson(_$ConfigImpl instance) => + { 'views_path': instance.viewsPath, 'services_path': instance.servicesPath, 'widgets_path': instance.widgetsPath, diff --git a/lib/src/models/template_models.freezed.dart b/lib/src/models/template_models.freezed.dart index 8238be5..9a1c116 100644 --- a/lib/src/models/template_models.freezed.dart +++ b/lib/src/models/template_models.freezed.dart @@ -12,7 +12,7 @@ part of 'template_models.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); CompliledTemplateFile _$CompliledTemplateFileFromJson( Map json) { @@ -40,8 +40,12 @@ mixin _$CompliledTemplateFile { /// The type of file to determine how we'll store it String get fileType => throw _privateConstructorUsedError; + /// Serializes this CompliledTemplateFile to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of CompliledTemplateFile + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $CompliledTemplateFileCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -72,6 +76,8 @@ class _$CompliledTemplateFileCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of CompliledTemplateFile + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -112,11 +118,12 @@ class _$CompliledTemplateFileCopyWithImpl<$Res, } /// @nodoc -abstract class _$$_CompliledTemplateFileCopyWith<$Res> +abstract class _$$CompliledTemplateFileImplCopyWith<$Res> implements $CompliledTemplateFileCopyWith<$Res> { - factory _$$_CompliledTemplateFileCopyWith(_$_CompliledTemplateFile value, - $Res Function(_$_CompliledTemplateFile) then) = - __$$_CompliledTemplateFileCopyWithImpl<$Res>; + factory _$$CompliledTemplateFileImplCopyWith( + _$CompliledTemplateFileImpl value, + $Res Function(_$CompliledTemplateFileImpl) then) = + __$$CompliledTemplateFileImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -129,13 +136,16 @@ abstract class _$$_CompliledTemplateFileCopyWith<$Res> } /// @nodoc -class __$$_CompliledTemplateFileCopyWithImpl<$Res> - extends _$CompliledTemplateFileCopyWithImpl<$Res, _$_CompliledTemplateFile> - implements _$$_CompliledTemplateFileCopyWith<$Res> { - __$$_CompliledTemplateFileCopyWithImpl(_$_CompliledTemplateFile _value, - $Res Function(_$_CompliledTemplateFile) _then) +class __$$CompliledTemplateFileImplCopyWithImpl<$Res> + extends _$CompliledTemplateFileCopyWithImpl<$Res, + _$CompliledTemplateFileImpl> + implements _$$CompliledTemplateFileImplCopyWith<$Res> { + __$$CompliledTemplateFileImplCopyWithImpl(_$CompliledTemplateFileImpl _value, + $Res Function(_$CompliledTemplateFileImpl) _then) : super(_value, _then); + /// Create a copy of CompliledTemplateFile + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -146,7 +156,7 @@ class __$$_CompliledTemplateFileCopyWithImpl<$Res> Object? content = null, Object? fileType = null, }) { - return _then(_$_CompliledTemplateFile( + return _then(_$CompliledTemplateFileImpl( name: null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable @@ -177,8 +187,8 @@ class __$$_CompliledTemplateFileCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_CompliledTemplateFile implements _CompliledTemplateFile { - _$_CompliledTemplateFile( +class _$CompliledTemplateFileImpl implements _CompliledTemplateFile { + _$CompliledTemplateFileImpl( {required this.name, required this.templateType, required this.fileName, @@ -186,8 +196,8 @@ class _$_CompliledTemplateFile implements _CompliledTemplateFile { required this.content, required this.fileType}); - factory _$_CompliledTemplateFile.fromJson(Map json) => - _$$_CompliledTemplateFileFromJson(json); + factory _$CompliledTemplateFileImpl.fromJson(Map json) => + _$$CompliledTemplateFileImplFromJson(json); /// Pascal case name of the template this file belongs too @override @@ -220,10 +230,10 @@ class _$_CompliledTemplateFile implements _CompliledTemplateFile { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_CompliledTemplateFile && + other is _$CompliledTemplateFileImpl && (identical(other.name, name) || other.name == name) && (identical(other.templateType, templateType) || other.templateType == templateType) && @@ -235,21 +245,23 @@ class _$_CompliledTemplateFile implements _CompliledTemplateFile { other.fileType == fileType)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, name, templateType, fileName, path, content, fileType); - @JsonKey(ignore: true) + /// Create a copy of CompliledTemplateFile + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$_CompliledTemplateFileCopyWith<_$_CompliledTemplateFile> get copyWith => - __$$_CompliledTemplateFileCopyWithImpl<_$_CompliledTemplateFile>( - this, _$identity); + _$$CompliledTemplateFileImplCopyWith<_$CompliledTemplateFileImpl> + get copyWith => __$$CompliledTemplateFileImplCopyWithImpl< + _$CompliledTemplateFileImpl>(this, _$identity); @override Map toJson() { - return _$$_CompliledTemplateFileToJson( + return _$$CompliledTemplateFileImplToJson( this, ); } @@ -262,40 +274,42 @@ abstract class _CompliledTemplateFile implements CompliledTemplateFile { required final String fileName, required final String path, required final String content, - required final String fileType}) = _$_CompliledTemplateFile; + required final String fileType}) = _$CompliledTemplateFileImpl; factory _CompliledTemplateFile.fromJson(Map json) = - _$_CompliledTemplateFile.fromJson; - - @override + _$CompliledTemplateFileImpl.fromJson; /// Pascal case name of the template this file belongs too - String get name; @override + String get name; /// Pascal case name of the template type this file belongs too, - String get templateType; @override + String get templateType; /// Pascal case name of the file without the extension - String get fileName; @override + String get fileName; /// Relative file path from the template in the templates folder /// .i.e. from we don't include template/view/ - String get path; @override + String get path; /// The content as is from the file that was read - String get content; @override + String get content; /// The type of file to determine how we'll store it + @override String get fileType; + + /// Create a copy of CompliledTemplateFile + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) - _$$_CompliledTemplateFileCopyWith<_$_CompliledTemplateFile> get copyWith => - throw _privateConstructorUsedError; + @JsonKey(includeFromJson: false, includeToJson: false) + _$$CompliledTemplateFileImplCopyWith<_$CompliledTemplateFileImpl> + get copyWith => throw _privateConstructorUsedError; } CompiledCreateCommand _$CompiledCreateCommandFromJson( @@ -308,8 +322,12 @@ mixin _$CompiledCreateCommand { String get name => throw _privateConstructorUsedError; List get templates => throw _privateConstructorUsedError; + /// Serializes this CompiledCreateCommand to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of CompiledCreateCommand + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $CompiledCreateCommandCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -334,6 +352,8 @@ class _$CompiledCreateCommandCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of CompiledCreateCommand + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -354,31 +374,35 @@ class _$CompiledCreateCommandCopyWithImpl<$Res, } /// @nodoc -abstract class _$$_CompiledCreateCommandCopyWith<$Res> +abstract class _$$CompiledCreateCommandImplCopyWith<$Res> implements $CompiledCreateCommandCopyWith<$Res> { - factory _$$_CompiledCreateCommandCopyWith(_$_CompiledCreateCommand value, - $Res Function(_$_CompiledCreateCommand) then) = - __$$_CompiledCreateCommandCopyWithImpl<$Res>; + factory _$$CompiledCreateCommandImplCopyWith( + _$CompiledCreateCommandImpl value, + $Res Function(_$CompiledCreateCommandImpl) then) = + __$$CompiledCreateCommandImplCopyWithImpl<$Res>; @override @useResult $Res call({String name, List templates}); } /// @nodoc -class __$$_CompiledCreateCommandCopyWithImpl<$Res> - extends _$CompiledCreateCommandCopyWithImpl<$Res, _$_CompiledCreateCommand> - implements _$$_CompiledCreateCommandCopyWith<$Res> { - __$$_CompiledCreateCommandCopyWithImpl(_$_CompiledCreateCommand _value, - $Res Function(_$_CompiledCreateCommand) _then) +class __$$CompiledCreateCommandImplCopyWithImpl<$Res> + extends _$CompiledCreateCommandCopyWithImpl<$Res, + _$CompiledCreateCommandImpl> + implements _$$CompiledCreateCommandImplCopyWith<$Res> { + __$$CompiledCreateCommandImplCopyWithImpl(_$CompiledCreateCommandImpl _value, + $Res Function(_$CompiledCreateCommandImpl) _then) : super(_value, _then); + /// Create a copy of CompiledCreateCommand + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ Object? name = null, Object? templates = null, }) { - return _then(_$_CompiledCreateCommand( + return _then(_$CompiledCreateCommandImpl( name: null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable @@ -393,13 +417,13 @@ class __$$_CompiledCreateCommandCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_CompiledCreateCommand implements _CompiledCreateCommand { - _$_CompiledCreateCommand( +class _$CompiledCreateCommandImpl implements _CompiledCreateCommand { + _$CompiledCreateCommandImpl( {required this.name, required final List templates}) : _templates = templates; - factory _$_CompiledCreateCommand.fromJson(Map json) => - _$$_CompiledCreateCommandFromJson(json); + factory _$CompiledCreateCommandImpl.fromJson(Map json) => + _$$CompiledCreateCommandImplFromJson(json); @override final String name; @@ -417,30 +441,32 @@ class _$_CompiledCreateCommand implements _CompiledCreateCommand { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_CompiledCreateCommand && + other is _$CompiledCreateCommandImpl && (identical(other.name, name) || other.name == name) && const DeepCollectionEquality() .equals(other._templates, _templates)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, name, const DeepCollectionEquality().hash(_templates)); - @JsonKey(ignore: true) + /// Create a copy of CompiledCreateCommand + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$_CompiledCreateCommandCopyWith<_$_CompiledCreateCommand> get copyWith => - __$$_CompiledCreateCommandCopyWithImpl<_$_CompiledCreateCommand>( - this, _$identity); + _$$CompiledCreateCommandImplCopyWith<_$CompiledCreateCommandImpl> + get copyWith => __$$CompiledCreateCommandImplCopyWithImpl< + _$CompiledCreateCommandImpl>(this, _$identity); @override Map toJson() { - return _$$_CompiledCreateCommandToJson( + return _$$CompiledCreateCommandImplToJson( this, ); } @@ -450,19 +476,22 @@ abstract class _CompiledCreateCommand implements CompiledCreateCommand { factory _CompiledCreateCommand( {required final String name, required final List templates}) = - _$_CompiledCreateCommand; + _$CompiledCreateCommandImpl; factory _CompiledCreateCommand.fromJson(Map json) = - _$_CompiledCreateCommand.fromJson; + _$CompiledCreateCommandImpl.fromJson; @override String get name; @override List get templates; + + /// Create a copy of CompiledCreateCommand + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) - _$$_CompiledCreateCommandCopyWith<_$_CompiledCreateCommand> get copyWith => - throw _privateConstructorUsedError; + @JsonKey(includeFromJson: false, includeToJson: false) + _$$CompiledCreateCommandImplCopyWith<_$CompiledCreateCommandImpl> + get copyWith => throw _privateConstructorUsedError; } CompiledTemplate _$CompiledTemplateFromJson(Map json) { @@ -476,8 +505,12 @@ mixin _$CompiledTemplate { List get modificationFiles => throw _privateConstructorUsedError; + /// Serializes this CompiledTemplate to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of CompiledTemplate + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $CompiledTemplateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -504,6 +537,8 @@ class _$CompiledTemplateCopyWithImpl<$Res, $Val extends CompiledTemplate> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of CompiledTemplate + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -529,11 +564,11 @@ class _$CompiledTemplateCopyWithImpl<$Res, $Val extends CompiledTemplate> } /// @nodoc -abstract class _$$_CompiledTemplateCopyWith<$Res> +abstract class _$$CompiledTemplateImplCopyWith<$Res> implements $CompiledTemplateCopyWith<$Res> { - factory _$$_CompiledTemplateCopyWith( - _$_CompiledTemplate value, $Res Function(_$_CompiledTemplate) then) = - __$$_CompiledTemplateCopyWithImpl<$Res>; + factory _$$CompiledTemplateImplCopyWith(_$CompiledTemplateImpl value, + $Res Function(_$CompiledTemplateImpl) then) = + __$$CompiledTemplateImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -543,13 +578,15 @@ abstract class _$$_CompiledTemplateCopyWith<$Res> } /// @nodoc -class __$$_CompiledTemplateCopyWithImpl<$Res> - extends _$CompiledTemplateCopyWithImpl<$Res, _$_CompiledTemplate> - implements _$$_CompiledTemplateCopyWith<$Res> { - __$$_CompiledTemplateCopyWithImpl( - _$_CompiledTemplate _value, $Res Function(_$_CompiledTemplate) _then) +class __$$CompiledTemplateImplCopyWithImpl<$Res> + extends _$CompiledTemplateCopyWithImpl<$Res, _$CompiledTemplateImpl> + implements _$$CompiledTemplateImplCopyWith<$Res> { + __$$CompiledTemplateImplCopyWithImpl(_$CompiledTemplateImpl _value, + $Res Function(_$CompiledTemplateImpl) _then) : super(_value, _then); + /// Create a copy of CompiledTemplate + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -557,7 +594,7 @@ class __$$_CompiledTemplateCopyWithImpl<$Res> Object? files = null, Object? modificationFiles = null, }) { - return _then(_$_CompiledTemplate( + return _then(_$CompiledTemplateImpl( type: null == type ? _value.type : type // ignore: cast_nullable_to_non_nullable @@ -576,16 +613,16 @@ class __$$_CompiledTemplateCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_CompiledTemplate implements _CompiledTemplate { - _$_CompiledTemplate( +class _$CompiledTemplateImpl implements _CompiledTemplate { + _$CompiledTemplateImpl( {required this.type, required final List files, final List modificationFiles = const []}) : _files = files, _modificationFiles = modificationFiles; - factory _$_CompiledTemplate.fromJson(Map json) => - _$$_CompiledTemplateFromJson(json); + factory _$CompiledTemplateImpl.fromJson(Map json) => + _$$CompiledTemplateImplFromJson(json); @override final String type; @@ -613,17 +650,17 @@ class _$_CompiledTemplate implements _CompiledTemplate { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_CompiledTemplate && + other is _$CompiledTemplateImpl && (identical(other.type, type) || other.type == type) && const DeepCollectionEquality().equals(other._files, _files) && const DeepCollectionEquality() .equals(other._modificationFiles, _modificationFiles)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, @@ -631,15 +668,18 @@ class _$_CompiledTemplate implements _CompiledTemplate { const DeepCollectionEquality().hash(_files), const DeepCollectionEquality().hash(_modificationFiles)); - @JsonKey(ignore: true) + /// Create a copy of CompiledTemplate + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$_CompiledTemplateCopyWith<_$_CompiledTemplate> get copyWith => - __$$_CompiledTemplateCopyWithImpl<_$_CompiledTemplate>(this, _$identity); + _$$CompiledTemplateImplCopyWith<_$CompiledTemplateImpl> get copyWith => + __$$CompiledTemplateImplCopyWithImpl<_$CompiledTemplateImpl>( + this, _$identity); @override Map toJson() { - return _$$_CompiledTemplateToJson( + return _$$CompiledTemplateImplToJson( this, ); } @@ -650,10 +690,10 @@ abstract class _CompiledTemplate implements CompiledTemplate { {required final String type, required final List files, final List modificationFiles}) = - _$_CompiledTemplate; + _$CompiledTemplateImpl; factory _CompiledTemplate.fromJson(Map json) = - _$_CompiledTemplate.fromJson; + _$CompiledTemplateImpl.fromJson; @override String get type; @@ -661,9 +701,12 @@ abstract class _CompiledTemplate implements CompiledTemplate { List get files; @override List get modificationFiles; + + /// Create a copy of CompiledTemplate + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) - _$$_CompiledTemplateCopyWith<_$_CompiledTemplate> get copyWith => + @JsonKey(includeFromJson: false, includeToJson: false) + _$$CompiledTemplateImplCopyWith<_$CompiledTemplateImpl> get copyWith => throw _privateConstructorUsedError; } @@ -692,8 +735,12 @@ mixin _$CompiledFileModification { /// The message to show the user of the cli if the modification succeeds String get name => throw _privateConstructorUsedError; + /// Serializes this CompiledFileModification to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of CompiledFileModification + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $CompiledFileModificationCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -724,6 +771,8 @@ class _$CompiledFileModificationCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of CompiledFileModification + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -764,12 +813,12 @@ class _$CompiledFileModificationCopyWithImpl<$Res, } /// @nodoc -abstract class _$$_CompiledFileModificationCopyWith<$Res> +abstract class _$$CompiledFileModificationImplCopyWith<$Res> implements $CompiledFileModificationCopyWith<$Res> { - factory _$$_CompiledFileModificationCopyWith( - _$_CompiledFileModification value, - $Res Function(_$_CompiledFileModification) then) = - __$$_CompiledFileModificationCopyWithImpl<$Res>; + factory _$$CompiledFileModificationImplCopyWith( + _$CompiledFileModificationImpl value, + $Res Function(_$CompiledFileModificationImpl) then) = + __$$CompiledFileModificationImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -782,14 +831,17 @@ abstract class _$$_CompiledFileModificationCopyWith<$Res> } /// @nodoc -class __$$_CompiledFileModificationCopyWithImpl<$Res> +class __$$CompiledFileModificationImplCopyWithImpl<$Res> extends _$CompiledFileModificationCopyWithImpl<$Res, - _$_CompiledFileModification> - implements _$$_CompiledFileModificationCopyWith<$Res> { - __$$_CompiledFileModificationCopyWithImpl(_$_CompiledFileModification _value, - $Res Function(_$_CompiledFileModification) _then) + _$CompiledFileModificationImpl> + implements _$$CompiledFileModificationImplCopyWith<$Res> { + __$$CompiledFileModificationImplCopyWithImpl( + _$CompiledFileModificationImpl _value, + $Res Function(_$CompiledFileModificationImpl) _then) : super(_value, _then); + /// Create a copy of CompiledFileModification + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -800,7 +852,7 @@ class __$$_CompiledFileModificationCopyWithImpl<$Res> Object? error = null, Object? name = null, }) { - return _then(_$_CompiledFileModification( + return _then(_$CompiledFileModificationImpl( description: null == description ? _value.description : description // ignore: cast_nullable_to_non_nullable @@ -831,8 +883,8 @@ class __$$_CompiledFileModificationCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_CompiledFileModification implements _CompiledFileModification { - _$_CompiledFileModification( +class _$CompiledFileModificationImpl implements _CompiledFileModification { + _$CompiledFileModificationImpl( {required this.description, required this.path, required this.identifier, @@ -840,8 +892,8 @@ class _$_CompiledFileModification implements _CompiledFileModification { required this.error, required this.name}); - factory _$_CompiledFileModification.fromJson(Map json) => - _$$_CompiledFileModificationFromJson(json); + factory _$CompiledFileModificationImpl.fromJson(Map json) => + _$$CompiledFileModificationImplFromJson(json); /// A short description for what this modiciation does @override @@ -873,10 +925,10 @@ class _$_CompiledFileModification implements _CompiledFileModification { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_CompiledFileModification && + other is _$CompiledFileModificationImpl && (identical(other.description, description) || other.description == description) && (identical(other.path, path) || other.path == path) && @@ -888,21 +940,23 @@ class _$_CompiledFileModification implements _CompiledFileModification { (identical(other.name, name) || other.name == name)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, description, path, identifier, template, error, name); - @JsonKey(ignore: true) + /// Create a copy of CompiledFileModification + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$_CompiledFileModificationCopyWith<_$_CompiledFileModification> - get copyWith => __$$_CompiledFileModificationCopyWithImpl< - _$_CompiledFileModification>(this, _$identity); + _$$CompiledFileModificationImplCopyWith<_$CompiledFileModificationImpl> + get copyWith => __$$CompiledFileModificationImplCopyWithImpl< + _$CompiledFileModificationImpl>(this, _$identity); @override Map toJson() { - return _$$_CompiledFileModificationToJson( + return _$$CompiledFileModificationImplToJson( this, ); } @@ -915,37 +969,39 @@ abstract class _CompiledFileModification implements CompiledFileModification { required final String identifier, required final String template, required final String error, - required final String name}) = _$_CompiledFileModification; + required final String name}) = _$CompiledFileModificationImpl; factory _CompiledFileModification.fromJson(Map json) = - _$_CompiledFileModification.fromJson; - - @override + _$CompiledFileModificationImpl.fromJson; /// A short description for what this modiciation does - String get description; @override + String get description; /// The relative path to the file that needs to be modified - String get path; @override + String get path; /// The identifier to use to determine location of modifications - String get identifier; @override + String get identifier; /// The mustache template to use when rendering the modification - String get template; @override + String get template; /// The message to show the user of the cli if the modification fails - String get error; @override + String get error; /// The message to show the user of the cli if the modification succeeds + @override String get name; + + /// Create a copy of CompiledFileModification + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) - _$$_CompiledFileModificationCopyWith<_$_CompiledFileModification> + @JsonKey(includeFromJson: false, includeToJson: false) + _$$CompiledFileModificationImplCopyWith<_$CompiledFileModificationImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/models/template_models.g.dart b/lib/src/models/template_models.g.dart index 853f818..107242c 100644 --- a/lib/src/models/template_models.g.dart +++ b/lib/src/models/template_models.g.dart @@ -6,9 +6,9 @@ part of 'template_models.dart'; // JsonSerializableGenerator // ************************************************************************** -_$_CompliledTemplateFile _$$_CompliledTemplateFileFromJson( +_$CompliledTemplateFileImpl _$$CompliledTemplateFileImplFromJson( Map json) => - _$_CompliledTemplateFile( + _$CompliledTemplateFileImpl( name: json['name'] as String, templateType: json['templateType'] as String, fileName: json['fileName'] as String, @@ -17,8 +17,8 @@ _$_CompliledTemplateFile _$$_CompliledTemplateFileFromJson( fileType: json['fileType'] as String, ); -Map _$$_CompliledTemplateFileToJson( - _$_CompliledTemplateFile instance) => +Map _$$CompliledTemplateFileImplToJson( + _$CompliledTemplateFileImpl instance) => { 'name': instance.name, 'templateType': instance.templateType, @@ -28,24 +28,25 @@ Map _$$_CompliledTemplateFileToJson( 'fileType': instance.fileType, }; -_$_CompiledCreateCommand _$$_CompiledCreateCommandFromJson( +_$CompiledCreateCommandImpl _$$CompiledCreateCommandImplFromJson( Map json) => - _$_CompiledCreateCommand( + _$CompiledCreateCommandImpl( name: json['name'] as String, templates: (json['templates'] as List) .map((e) => CompiledTemplate.fromJson(e as Map)) .toList(), ); -Map _$$_CompiledCreateCommandToJson( - _$_CompiledCreateCommand instance) => +Map _$$CompiledCreateCommandImplToJson( + _$CompiledCreateCommandImpl instance) => { 'name': instance.name, 'templates': instance.templates.map((e) => e.toJson()).toList(), }; -_$_CompiledTemplate _$$_CompiledTemplateFromJson(Map json) => - _$_CompiledTemplate( +_$CompiledTemplateImpl _$$CompiledTemplateImplFromJson( + Map json) => + _$CompiledTemplateImpl( type: json['type'] as String, files: (json['files'] as List) .map((e) => CompliledTemplateFile.fromJson(e as Map)) @@ -57,7 +58,8 @@ _$_CompiledTemplate _$$_CompiledTemplateFromJson(Map json) => const [], ); -Map _$$_CompiledTemplateToJson(_$_CompiledTemplate instance) => +Map _$$CompiledTemplateImplToJson( + _$CompiledTemplateImpl instance) => { 'type': instance.type, 'files': instance.files.map((e) => e.toJson()).toList(), @@ -65,9 +67,9 @@ Map _$$_CompiledTemplateToJson(_$_CompiledTemplate instance) => instance.modificationFiles.map((e) => e.toJson()).toList(), }; -_$_CompiledFileModification _$$_CompiledFileModificationFromJson( +_$CompiledFileModificationImpl _$$CompiledFileModificationImplFromJson( Map json) => - _$_CompiledFileModification( + _$CompiledFileModificationImpl( description: json['description'] as String, path: json['path'] as String, identifier: json['identifier'] as String, @@ -76,8 +78,8 @@ _$_CompiledFileModification _$$_CompiledFileModificationFromJson( name: json['name'] as String, ); -Map _$$_CompiledFileModificationToJson( - _$_CompiledFileModification instance) => +Map _$$CompiledFileModificationImplToJson( + _$CompiledFileModificationImpl instance) => { 'description': instance.description, 'path': instance.path, diff --git a/lib/src/services/template_service.dart b/lib/src/services/template_service.dart index 5221101..0bd6c9c 100644 --- a/lib/src/services/template_service.dart +++ b/lib/src/services/template_service.dart @@ -154,6 +154,9 @@ class TemplateService { /// When supplied it selects the template type to use within the command that's being /// run. This is supplied using --template=web or similar based on the command being run required String templateType, + + /// When set to true, no test files will be generated + bool noTest = false, }) async { // Get the template that we want to render final template = kCompiledStackedTemplates[templateName]![templateType] ?? @@ -166,6 +169,7 @@ class TemplateService { outputFolder: outputPath, useBuilder: useBuilder, hasModel: hasModel, + noTest: noTest, ); if (templateName == kTemplateNameView && excludeRoute) { @@ -187,6 +191,7 @@ class TemplateService { String? outputFolder, bool useBuilder = false, bool hasModel = true, + bool noTest = false, }) async { /// Sort template files to ensure default view will be always after v1 view. template.templateFiles.sort( @@ -230,6 +235,11 @@ class TemplateService { } } + /// Skip test files if noTest flag is true + if (noTest && templateFile.relativeOutputPath.contains('test/')) { + continue; + } + final templateContent = templateFile.fileType == FileType.text ? renderContentForTemplate( content: templateFile.content, diff --git a/test/helpers/test_helpers.mocks.dart b/test/helpers/test_helpers.mocks.dart index 1ea99ea..d1a914c 100644 --- a/test/helpers/test_helpers.mocks.dart +++ b/test/helpers/test_helpers.mocks.dart @@ -1,9 +1,7 @@ -// Mocks generated by Mockito 5.4.1 from annotations +// Mocks generated by Mockito 5.4.6 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; @@ -11,27 +9,31 @@ import 'dart:typed_data' as _i7; import 'package:ansicolor/ansicolor.dart' as _i4; import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i8; import 'package:pubspec_yaml/pubspec_yaml.dart' as _i3; -import 'package:stacked_cli/src/models/template_models.dart' as _i10; -import 'package:stacked_cli/src/services/colorized_log_service.dart' as _i14; -import 'package:stacked_cli/src/services/config_service.dart' as _i15; +import 'package:stacked_cli/src/models/template_models.dart' as _i11; +import 'package:stacked_cli/src/services/colorized_log_service.dart' as _i15; +import 'package:stacked_cli/src/services/config_service.dart' as _i16; import 'package:stacked_cli/src/services/file_service.dart' as _i5; -import 'package:stacked_cli/src/services/path_service.dart' as _i8; -import 'package:stacked_cli/src/services/posthog_service.dart' as _i17; -import 'package:stacked_cli/src/services/process_service.dart' as _i16; -import 'package:stacked_cli/src/services/pub_service.dart' as _i18; -import 'package:stacked_cli/src/services/pubspec_service.dart' as _i13; -import 'package:stacked_cli/src/services/template_service.dart' as _i9; -import 'package:stacked_cli/src/templates/template_helper.dart' as _i12; +import 'package:stacked_cli/src/services/path_service.dart' as _i9; +import 'package:stacked_cli/src/services/posthog_service.dart' as _i18; +import 'package:stacked_cli/src/services/process_service.dart' as _i17; +import 'package:stacked_cli/src/services/pub_service.dart' as _i19; +import 'package:stacked_cli/src/services/pubspec_service.dart' as _i14; +import 'package:stacked_cli/src/services/template_service.dart' as _i10; +import 'package:stacked_cli/src/templates/template_helper.dart' as _i13; import 'package:stacked_cli/src/templates/template_render_functions.dart' - as _i11; + as _i12; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references +// ignore_for_file: deprecated_member_use +// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types @@ -67,16 +69,6 @@ class _FakeAnsiPen_2 extends _i1.SmartFake implements _i4.AnsiPen { ); } -class _FakeProcessResult_3 extends _i1.SmartFake implements _i2.ProcessResult { - _FakeProcessResult_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); -} - /// A class which mocks [FileService]. /// /// See the documentation for Mockito's code generation for more information. @@ -106,6 +98,7 @@ class MockFileService extends _i1.Mock implements _i5.FileService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future writeDataFile({ required _i2.File? file, @@ -131,6 +124,7 @@ class MockFileService extends _i1.Mock implements _i5.FileService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future deleteFile({ required String? filePath, @@ -148,6 +142,7 @@ class MockFileService extends _i1.Mock implements _i5.FileService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future deleteFolder({required String? directoryPath}) => (super.noSuchMethod( @@ -159,6 +154,7 @@ class MockFileService extends _i1.Mock implements _i5.FileService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future fileExists({required String? filePath}) => (super.noSuchMethod( @@ -170,6 +166,7 @@ class MockFileService extends _i1.Mock implements _i5.FileService { returnValue: _i6.Future.value(false), returnValueForMissingStub: _i6.Future.value(false), ) as _i6.Future); + @override _i6.Future readFileAsString({required String? filePath}) => (super.noSuchMethod( @@ -178,9 +175,25 @@ class MockFileService extends _i1.Mock implements _i5.FileService { [], {#filePath: filePath}, ), - returnValue: _i6.Future.value(''), - returnValueForMissingStub: _i6.Future.value(''), + returnValue: _i6.Future.value(_i8.dummyValue( + this, + Invocation.method( + #readFileAsString, + [], + {#filePath: filePath}, + ), + )), + returnValueForMissingStub: + _i6.Future.value(_i8.dummyValue( + this, + Invocation.method( + #readFileAsString, + [], + {#filePath: filePath}, + ), + )), ) as _i6.Future); + @override _i6.Future<_i7.Uint8List> readAsBytes({required String? filePath}) => (super.noSuchMethod( @@ -193,6 +206,7 @@ class MockFileService extends _i1.Mock implements _i5.FileService { returnValueForMissingStub: _i6.Future<_i7.Uint8List>.value(_i7.Uint8List(0)), ) as _i6.Future<_i7.Uint8List>); + @override _i6.Future> readFileAsLines({required String? filePath}) => (super.noSuchMethod( @@ -204,11 +218,12 @@ class MockFileService extends _i1.Mock implements _i5.FileService { returnValue: _i6.Future>.value([]), returnValueForMissingStub: _i6.Future>.value([]), ) as _i6.Future>); + @override _i6.Future removeSpecificFileLines({ required String? filePath, required String? removedContent, - String? type = r'view', + String? type = 'view', }) => (super.noSuchMethod( Invocation.method( @@ -223,6 +238,7 @@ class MockFileService extends _i1.Mock implements _i5.FileService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future removeLinesOnFile({ required String? filePath, @@ -240,6 +256,7 @@ class MockFileService extends _i1.Mock implements _i5.FileService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future removeTestHelperFunctionFromFile({ required String? filePath, @@ -257,6 +274,7 @@ class MockFileService extends _i1.Mock implements _i5.FileService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future> getFilesInDirectory( {required String? directoryPath}) => @@ -271,6 +289,7 @@ class MockFileService extends _i1.Mock implements _i5.FileService { returnValueForMissingStub: _i6.Future>.value( <_i2.FileSystemEntity>[]), ) as _i6.Future>); + @override _i6.Future> getFoldersInDirectory( {required String? directoryPath}) => @@ -288,19 +307,33 @@ class MockFileService extends _i1.Mock implements _i5.FileService { /// A class which mocks [PathService]. /// /// See the documentation for Mockito's code generation for more information. -class MockPathService extends _i1.Mock implements _i8.PathService { +class MockPathService extends _i1.Mock implements _i9.PathService { @override String get templatesPath => (super.noSuchMethod( Invocation.getter(#templatesPath), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#templatesPath), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#templatesPath), + ), ) as String); + @override String get separator => (super.noSuchMethod( Invocation.getter(#separator), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#separator), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#separator), + ), ) as String); + @override _i2.Directory get configHome => (super.noSuchMethod( Invocation.getter(#configHome), @@ -313,6 +346,7 @@ class MockPathService extends _i1.Mock implements _i8.PathService { Invocation.getter(#configHome), ), ) as _i2.Directory); + @override String join( String? part1, [ @@ -338,24 +372,67 @@ class MockPathService extends _i1.Mock implements _i8.PathService { part8, ], ), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.method( + #join, + [ + part1, + part2, + part3, + part4, + part5, + part6, + part7, + part8, + ], + ), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.method( + #join, + [ + part1, + part2, + part3, + part4, + part5, + part6, + part7, + part8, + ], + ), + ), ) as String); + @override String basename(String? path) => (super.noSuchMethod( Invocation.method( #basename, [path], ), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.method( + #basename, + [path], + ), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.method( + #basename, + [path], + ), + ), ) as String); } /// A class which mocks [TemplateService]. /// /// See the documentation for Mockito's code generation for more information. -class MockTemplateService extends _i1.Mock implements _i9.TemplateService { +class MockTemplateService extends _i1.Mock implements _i10.TemplateService { @override _i6.Future compileTemplateInformation() => (super.noSuchMethod( Invocation.method( @@ -365,6 +442,7 @@ class MockTemplateService extends _i1.Mock implements _i9.TemplateService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future renderTemplate({ required String? templateName, @@ -375,6 +453,7 @@ class MockTemplateService extends _i1.Mock implements _i9.TemplateService { bool? hasModel = true, String? outputPath, required String? templateType, + bool? noTest = false, }) => (super.noSuchMethod( Invocation.method( @@ -389,19 +468,22 @@ class MockTemplateService extends _i1.Mock implements _i9.TemplateService { #hasModel: hasModel, #outputPath: outputPath, #templateType: templateType, + #noTest: noTest, }, ), returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future writeOutTemplateFiles({ - required _i10.StackedTemplate? template, + required _i11.StackedTemplate? template, required String? templateName, required String? name, String? outputFolder, bool? useBuilder = false, bool? hasModel = true, + bool? noTest = false, }) => (super.noSuchMethod( Invocation.method( @@ -414,11 +496,13 @@ class MockTemplateService extends _i1.Mock implements _i9.TemplateService { #outputFolder: outputFolder, #useBuilder: useBuilder, #hasModel: hasModel, + #noTest: noTest, }, ), returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override String getTemplateOutputPath({ required String? inputTemplatePath, @@ -435,9 +519,32 @@ class MockTemplateService extends _i1.Mock implements _i9.TemplateService { #outputFolder: outputFolder, }, ), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.method( + #getTemplateOutputPath, + [], + { + #inputTemplatePath: inputTemplatePath, + #name: name, + #outputFolder: outputFolder, + }, + ), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.method( + #getTemplateOutputPath, + [], + { + #inputTemplatePath: inputTemplatePath, + #name: name, + #outputFolder: outputFolder, + }, + ), + ), ) as String); + @override String renderContentForTemplate({ required String? content, @@ -454,14 +561,37 @@ class MockTemplateService extends _i1.Mock implements _i9.TemplateService { #name: name, }, ), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.method( + #renderContentForTemplate, + [], + { + #content: content, + #templateName: templateName, + #name: name, + }, + ), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.method( + #renderContentForTemplate, + [], + { + #content: content, + #templateName: templateName, + #name: name, + }, + ), + ), ) as String); + @override Map getTemplateRenderData({ required String? templateName, required String? name, - Map? testRenderFunctions, + Map? testRenderFunctions, }) => (super.noSuchMethod( Invocation.method( @@ -476,6 +606,7 @@ class MockTemplateService extends _i1.Mock implements _i9.TemplateService { returnValue: {}, returnValueForMissingStub: {}, ) as Map); + @override Map applyGlobalTemplateProperties( Map? renderTemplate, { @@ -490,9 +621,10 @@ class MockTemplateService extends _i1.Mock implements _i9.TemplateService { returnValue: {}, returnValueForMissingStub: {}, ) as Map); + @override _i6.Future modifyExistingFiles({ - required _i10.StackedTemplate? template, + required _i11.StackedTemplate? template, required String? templateName, required String? name, String? outputPath, @@ -511,6 +643,7 @@ class MockTemplateService extends _i1.Mock implements _i9.TemplateService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override String templateModificationName({ required String? modificationName, @@ -527,9 +660,32 @@ class MockTemplateService extends _i1.Mock implements _i9.TemplateService { #templateName: templateName, }, ), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.method( + #templateModificationName, + [], + { + #modificationName: modificationName, + #name: name, + #templateName: templateName, + }, + ), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.method( + #templateModificationName, + [], + { + #modificationName: modificationName, + #name: name, + #templateName: templateName, + }, + ), + ), ) as String); + @override String templateModificationFileContent({ required String? fileContent, @@ -550,9 +706,36 @@ class MockTemplateService extends _i1.Mock implements _i9.TemplateService { #templateName: templateName, }, ), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.method( + #templateModificationFileContent, + [], + { + #fileContent: fileContent, + #modificationTemplate: modificationTemplate, + #modificationIdentifier: modificationIdentifier, + #name: name, + #templateName: templateName, + }, + ), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.method( + #templateModificationFileContent, + [], + { + #fileContent: fileContent, + #modificationTemplate: modificationTemplate, + #modificationIdentifier: modificationIdentifier, + #name: name, + #templateName: templateName, + }, + ), + ), ) as String); + @override bool shouldAppendTemplate(String? relativeOutputPath) => (super.noSuchMethod( Invocation.method( @@ -567,13 +750,33 @@ class MockTemplateService extends _i1.Mock implements _i9.TemplateService { /// A class which mocks [TemplateHelper]. /// /// See the documentation for Mockito's code generation for more information. -class MockTemplateHelper extends _i1.Mock implements _i12.TemplateHelper { +class MockTemplateHelper extends _i1.Mock implements _i13.TemplateHelper { @override String get packageDescription => (super.noSuchMethod( Invocation.getter(#packageDescription), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#packageDescription), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#packageDescription), + ), + ) as String); + + @override + String get templatesPath => (super.noSuchMethod( + Invocation.getter(#templatesPath), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#templatesPath), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#templatesPath), + ), ) as String); + @override set packageDescription(String? _packageDescription) => super.noSuchMethod( Invocation.setter( @@ -582,12 +785,7 @@ class MockTemplateHelper extends _i1.Mock implements _i12.TemplateHelper { ), returnValueForMissingStub: null, ); - @override - String get templatesPath => (super.noSuchMethod( - Invocation.getter(#templatesPath), - returnValue: '', - returnValueForMissingStub: '', - ) as String); + @override List<_i2.FileSystemEntity> getFilesWithExtension({ required List<_i2.FileSystemEntity>? filePaths, @@ -605,6 +803,7 @@ class MockTemplateHelper extends _i1.Mock implements _i12.TemplateHelper { returnValue: <_i2.FileSystemEntity>[], returnValueForMissingStub: <_i2.FileSystemEntity>[], ) as List<_i2.FileSystemEntity>); + @override List<_i2.FileSystemEntity> getFilesThatContainSection({ required List<_i2.FileSystemEntity>? files, @@ -622,6 +821,7 @@ class MockTemplateHelper extends _i1.Mock implements _i12.TemplateHelper { returnValue: <_i2.FileSystemEntity>[], returnValueForMissingStub: <_i2.FileSystemEntity>[], ) as List<_i2.FileSystemEntity>); + @override String getTemplateFileNameOnly( {required _i2.FileSystemEntity? templateFilePath}) => @@ -631,9 +831,24 @@ class MockTemplateHelper extends _i1.Mock implements _i12.TemplateHelper { [], {#templateFilePath: templateFilePath}, ), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.method( + #getTemplateFileNameOnly, + [], + {#templateFilePath: templateFilePath}, + ), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.method( + #getTemplateFileNameOnly, + [], + {#templateFilePath: templateFilePath}, + ), + ), ) as String); + @override String getTemplateFolderName({required String? templateFilePath}) => (super.noSuchMethod( @@ -642,9 +857,24 @@ class MockTemplateHelper extends _i1.Mock implements _i12.TemplateHelper { [], {#templateFilePath: templateFilePath}, ), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.method( + #getTemplateFolderName, + [], + {#templateFilePath: templateFilePath}, + ), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.method( + #getTemplateFolderName, + [], + {#templateFilePath: templateFilePath}, + ), + ), ) as String); + @override _i6.Future> getTemplateTypesFromTemplate( {required String? templateDirectoryPath}) => @@ -657,11 +887,12 @@ class MockTemplateHelper extends _i1.Mock implements _i12.TemplateHelper { returnValue: _i6.Future>.value([]), returnValueForMissingStub: _i6.Future>.value([]), ) as _i6.Future>); + @override _i6.Future> getFilesForTemplate({ required String? templateName, required String? templateType, - String? extension = r'stk', + String? extension = 'stk', }) => (super.noSuchMethod( Invocation.method( @@ -678,8 +909,9 @@ class MockTemplateHelper extends _i1.Mock implements _i12.TemplateHelper { returnValueForMissingStub: _i6.Future>.value( <_i2.FileSystemEntity>[]), ) as _i6.Future>); + @override - _i6.Future> + _i6.Future> getTemplateModificationsToApply({ required String? templateName, required String? templateType, @@ -693,14 +925,15 @@ class MockTemplateHelper extends _i1.Mock implements _i12.TemplateHelper { #templateType: templateType, }, ), - returnValue: _i6.Future>.value( - <_i10.CompiledFileModification>[]), + returnValue: _i6.Future>.value( + <_i11.CompiledFileModification>[]), returnValueForMissingStub: - _i6.Future>.value( - <_i10.CompiledFileModification>[]), - ) as _i6.Future>); + _i6.Future>.value( + <_i11.CompiledFileModification>[]), + ) as _i6.Future>); + @override - _i6.Future> getTemplateItemsToRender({ + _i6.Future> getTemplateItemsToRender({ required String? templateName, required String? templateType, }) => @@ -713,18 +946,18 @@ class MockTemplateHelper extends _i1.Mock implements _i12.TemplateHelper { #templateType: templateType, }, ), - returnValue: _i6.Future>.value( - <_i10.CompliledTemplateFile>[]), + returnValue: _i6.Future>.value( + <_i11.CompliledTemplateFile>[]), returnValueForMissingStub: - _i6.Future>.value( - <_i10.CompliledTemplateFile>[]), - ) as _i6.Future>); + _i6.Future>.value( + <_i11.CompliledTemplateFile>[]), + ) as _i6.Future>); } /// A class which mocks [PubspecService]. /// /// See the documentation for Mockito's code generation for more information. -class MockPubspecService extends _i1.Mock implements _i13.PubspecService { +class MockPubspecService extends _i1.Mock implements _i14.PubspecService { @override _i3.PubspecYaml get pubspecYaml => (super.noSuchMethod( Invocation.getter(#pubspecYaml), @@ -737,6 +970,20 @@ class MockPubspecService extends _i1.Mock implements _i13.PubspecService { Invocation.getter(#pubspecYaml), ), ) as _i3.PubspecYaml); + + @override + String get getPackageName => (super.noSuchMethod( + Invocation.getter(#getPackageName), + returnValue: _i8.dummyValue( + this, + Invocation.getter(#getPackageName), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#getPackageName), + ), + ) as String); + @override set pubspecYaml(_i3.PubspecYaml? _pubspecYaml) => super.noSuchMethod( Invocation.setter( @@ -745,12 +992,7 @@ class MockPubspecService extends _i1.Mock implements _i13.PubspecService { ), returnValueForMissingStub: null, ); - @override - String get getPackageName => (super.noSuchMethod( - Invocation.getter(#getPackageName), - returnValue: '', - returnValueForMissingStub: '', - ) as String); + @override _i6.Future initialise({String? workingDirectory}) => (super.noSuchMethod( @@ -768,7 +1010,7 @@ class MockPubspecService extends _i1.Mock implements _i13.PubspecService { /// /// See the documentation for Mockito's code generation for more information. class MockColorizedLogService extends _i1.Mock - implements _i14.ColorizedLogService { + implements _i15.ColorizedLogService { @override _i4.AnsiPen get pen => (super.noSuchMethod( Invocation.getter(#pen), @@ -781,6 +1023,7 @@ class MockColorizedLogService extends _i1.Mock Invocation.getter(#pen), ), ) as _i4.AnsiPen); + @override set pen(_i4.AnsiPen? _pen) => super.noSuchMethod( Invocation.setter( @@ -789,6 +1032,7 @@ class MockColorizedLogService extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void coloredPrint( _i4.AnsiPen? pen, { @@ -802,6 +1046,7 @@ class MockColorizedLogService extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void fileOutput({ required _i5.FileModificationType? type, @@ -818,6 +1063,7 @@ class MockColorizedLogService extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void flutterOutput({required String? message}) => super.noSuchMethod( Invocation.method( @@ -827,6 +1073,7 @@ class MockColorizedLogService extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void stackedOutput({ required String? message, @@ -843,6 +1090,7 @@ class MockColorizedLogService extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void success({required String? message}) => super.noSuchMethod( Invocation.method( @@ -852,6 +1100,7 @@ class MockColorizedLogService extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void warn({required String? message}) => super.noSuchMethod( Invocation.method( @@ -861,6 +1110,7 @@ class MockColorizedLogService extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void info({required String? message}) => super.noSuchMethod( Invocation.method( @@ -870,6 +1120,7 @@ class MockColorizedLogService extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void error({required String? message}) => super.noSuchMethod( Invocation.method( @@ -884,151 +1135,295 @@ class MockColorizedLogService extends _i1.Mock /// A class which mocks [ConfigService]. /// /// See the documentation for Mockito's code generation for more information. -class MockConfigService extends _i1.Mock implements _i15.ConfigService { +class MockConfigService extends _i1.Mock implements _i16.ConfigService { @override bool get hasCustomConfig => (super.noSuchMethod( Invocation.getter(#hasCustomConfig), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override String get serviceImportPath => (super.noSuchMethod( Invocation.getter(#serviceImportPath), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#serviceImportPath), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#serviceImportPath), + ), ) as String); + @override String get servicePath => (super.noSuchMethod( Invocation.getter(#servicePath), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#servicePath), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#servicePath), + ), ) as String); + @override String get locatorName => (super.noSuchMethod( Invocation.getter(#locatorName), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#locatorName), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#locatorName), + ), ) as String); + @override String get registerMocksFunction => (super.noSuchMethod( Invocation.getter(#registerMocksFunction), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#registerMocksFunction), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#registerMocksFunction), + ), ) as String); + @override String get serviceTestHelpersImport => (super.noSuchMethod( Invocation.getter(#serviceTestHelpersImport), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#serviceTestHelpersImport), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#serviceTestHelpersImport), + ), ) as String); + @override String get bottomSheetsPath => (super.noSuchMethod( Invocation.getter(#bottomSheetsPath), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#bottomSheetsPath), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#bottomSheetsPath), + ), ) as String); + @override String get bottomSheetBuilderFilePath => (super.noSuchMethod( Invocation.getter(#bottomSheetBuilderFilePath), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#bottomSheetBuilderFilePath), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#bottomSheetBuilderFilePath), + ), ) as String); + @override String get bottomSheetTypeFilePath => (super.noSuchMethod( Invocation.getter(#bottomSheetTypeFilePath), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#bottomSheetTypeFilePath), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#bottomSheetTypeFilePath), + ), ) as String); + @override String get dialogsPath => (super.noSuchMethod( Invocation.getter(#dialogsPath), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#dialogsPath), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#dialogsPath), + ), ) as String); + @override String get dialogBuilderFilePath => (super.noSuchMethod( Invocation.getter(#dialogBuilderFilePath), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#dialogBuilderFilePath), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#dialogBuilderFilePath), + ), ) as String); + @override String get dialogTypeFilePath => (super.noSuchMethod( Invocation.getter(#dialogTypeFilePath), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#dialogTypeFilePath), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#dialogTypeFilePath), + ), ) as String); + @override String get stackedAppFilePath => (super.noSuchMethod( Invocation.getter(#stackedAppFilePath), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#stackedAppFilePath), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#stackedAppFilePath), + ), ) as String); + @override String get testHelpersFilePath => (super.noSuchMethod( Invocation.getter(#testHelpersFilePath), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#testHelpersFilePath), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#testHelpersFilePath), + ), ) as String); + @override String get testServicesPath => (super.noSuchMethod( Invocation.getter(#testServicesPath), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#testServicesPath), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#testServicesPath), + ), ) as String); + @override String get testViewsPath => (super.noSuchMethod( Invocation.getter(#testViewsPath), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#testViewsPath), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#testViewsPath), + ), ) as String); + @override String get viewImportPath => (super.noSuchMethod( Invocation.getter(#viewImportPath), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#viewImportPath), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#viewImportPath), + ), ) as String); + @override String get viewPath => (super.noSuchMethod( Invocation.getter(#viewPath), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#viewPath), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#viewPath), + ), ) as String); + @override String get viewTestHelpersImport => (super.noSuchMethod( Invocation.getter(#viewTestHelpersImport), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#viewTestHelpersImport), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#viewTestHelpersImport), + ), ) as String); + @override String get widgetPath => (super.noSuchMethod( Invocation.getter(#widgetPath), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#widgetPath), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#widgetPath), + ), ) as String); + @override String get widgetTestHelpersImport => (super.noSuchMethod( Invocation.getter(#widgetTestHelpersImport), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#widgetTestHelpersImport), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#widgetTestHelpersImport), + ), ) as String); + @override bool get v1 => (super.noSuchMethod( Invocation.getter(#v1), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override int get lineLength => (super.noSuchMethod( Invocation.getter(#lineLength), returnValue: 0, returnValueForMissingStub: 0, ) as int); + @override bool get preferWeb => (super.noSuchMethod( Invocation.getter(#preferWeb), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override _i6.Future findAndLoadConfigFile({String? configFilePath}) => (super.noSuchMethod( @@ -1040,6 +1435,7 @@ class MockConfigService extends _i1.Mock implements _i15.ConfigService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future composeAndLoadConfigFile({ String? configFilePath, @@ -1057,6 +1453,7 @@ class MockConfigService extends _i1.Mock implements _i15.ConfigService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future resolveConfigFile({String? configFilePath}) => (super.noSuchMethod( @@ -1065,9 +1462,25 @@ class MockConfigService extends _i1.Mock implements _i15.ConfigService { [], {#configFilePath: configFilePath}, ), - returnValue: _i6.Future.value(''), - returnValueForMissingStub: _i6.Future.value(''), + returnValue: _i6.Future.value(_i8.dummyValue( + this, + Invocation.method( + #resolveConfigFile, + [], + {#configFilePath: configFilePath}, + ), + )), + returnValueForMissingStub: + _i6.Future.value(_i8.dummyValue( + this, + Invocation.method( + #resolveConfigFile, + [], + {#configFilePath: configFilePath}, + ), + )), ) as _i6.Future); + @override _i6.Future composeConfigFile({ String? configFilePath, @@ -1082,9 +1495,31 @@ class MockConfigService extends _i1.Mock implements _i15.ConfigService { #projectPath: projectPath, }, ), - returnValue: _i6.Future.value(''), - returnValueForMissingStub: _i6.Future.value(''), + returnValue: _i6.Future.value(_i8.dummyValue( + this, + Invocation.method( + #composeConfigFile, + [], + { + #configFilePath: configFilePath, + #projectPath: projectPath, + }, + ), + )), + returnValueForMissingStub: + _i6.Future.value(_i8.dummyValue( + this, + Invocation.method( + #composeConfigFile, + [], + { + #configFilePath: configFilePath, + #projectPath: projectPath, + }, + ), + )), ) as _i6.Future); + @override _i6.Future loadConfig(String? configFilePath) => (super.noSuchMethod( Invocation.method( @@ -1094,19 +1529,33 @@ class MockConfigService extends _i1.Mock implements _i15.ConfigService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override String replaceCustomPaths(String? path) => (super.noSuchMethod( Invocation.method( #replaceCustomPaths, [path], ), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.method( + #replaceCustomPaths, + [path], + ), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.method( + #replaceCustomPaths, + [path], + ), + ), ) as String); + @override String sanitizePath( String? path, [ - String? find = r'lib/', + String? find = 'lib/', ]) => (super.noSuchMethod( Invocation.method( @@ -1116,27 +1565,72 @@ class MockConfigService extends _i1.Mock implements _i15.ConfigService { find, ], ), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.method( + #sanitizePath, + [ + path, + find, + ], + ), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.method( + #sanitizePath, + [ + path, + find, + ], + ), + ), ) as String); + @override String getFilePathToHelpersAndMocks(String? path) => (super.noSuchMethod( Invocation.method( #getFilePathToHelpersAndMocks, [path], ), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.method( + #getFilePathToHelpersAndMocks, + [path], + ), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.method( + #getFilePathToHelpersAndMocks, + [path], + ), + ), ) as String); + @override String exportConfig() => (super.noSuchMethod( Invocation.method( #exportConfig, [], ), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.method( + #exportConfig, + [], + ), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.method( + #exportConfig, + [], + ), + ), ) as String); + @override void setWidgetsPath(String? path) => super.noSuchMethod( Invocation.method( @@ -1150,7 +1644,7 @@ class MockConfigService extends _i1.Mock implements _i15.ConfigService { /// A class which mocks [ProcessService]. /// /// See the documentation for Mockito's code generation for more information. -class MockProcessService extends _i1.Mock implements _i16.ProcessService { +class MockProcessService extends _i1.Mock implements _i17.ProcessService { @override set formattingLineLength(String? length) => super.noSuchMethod( Invocation.setter( @@ -1159,6 +1653,7 @@ class MockProcessService extends _i1.Mock implements _i16.ProcessService { ), returnValueForMissingStub: null, ); + @override _i6.Future runCreateApp({ required String? name, @@ -1180,6 +1675,7 @@ class MockProcessService extends _i1.Mock implements _i16.ProcessService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future runBuildRunner({ String? workingDirectory, @@ -1199,6 +1695,7 @@ class MockProcessService extends _i1.Mock implements _i16.ProcessService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future runPubGet({String? appName}) => (super.noSuchMethod( Invocation.method( @@ -1209,6 +1706,7 @@ class MockProcessService extends _i1.Mock implements _i16.ProcessService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future runFormat({ String? appName, @@ -1226,6 +1724,7 @@ class MockProcessService extends _i1.Mock implements _i16.ProcessService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future runPubGlobalActivate() => (super.noSuchMethod( Invocation.method( @@ -1235,6 +1734,7 @@ class MockProcessService extends _i1.Mock implements _i16.ProcessService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future> runPubGlobalList() => (super.noSuchMethod( Invocation.method( @@ -1244,6 +1744,7 @@ class MockProcessService extends _i1.Mock implements _i16.ProcessService { returnValue: _i6.Future>.value([]), returnValueForMissingStub: _i6.Future>.value([]), ) as _i6.Future>); + @override _i6.Future> runAnalyze({String? appName}) => (super.noSuchMethod( Invocation.method( @@ -1254,6 +1755,7 @@ class MockProcessService extends _i1.Mock implements _i16.ProcessService { returnValue: _i6.Future>.value([]), returnValueForMissingStub: _i6.Future>.value([]), ) as _i6.Future>); + @override void logSuccessStatus(int? exitCode) => super.noSuchMethod( Invocation.method( @@ -1267,25 +1769,28 @@ class MockProcessService extends _i1.Mock implements _i16.ProcessService { /// A class which mocks [PosthogService]. /// /// See the documentation for Mockito's code generation for more information. -class MockPosthogService extends _i1.Mock implements _i17.PosthogService { +class MockPosthogService extends _i1.Mock implements _i18.PosthogService { @override bool get verbose => (super.noSuchMethod( Invocation.getter(#verbose), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get isFirstRun => (super.noSuchMethod( Invocation.getter(#isFirstRun), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get enabled => (super.noSuchMethod( Invocation.getter(#enabled), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override _i6.Future enable(bool? value) => (super.noSuchMethod( Invocation.method( @@ -1295,6 +1800,7 @@ class MockPosthogService extends _i1.Mock implements _i17.PosthogService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future init() => (super.noSuchMethod( Invocation.method( @@ -1304,6 +1810,7 @@ class MockPosthogService extends _i1.Mock implements _i17.PosthogService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future createAppEvent({ required String? name, @@ -1321,6 +1828,7 @@ class MockPosthogService extends _i1.Mock implements _i17.PosthogService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future createBottomSheetEvent({ required String? name, @@ -1338,6 +1846,7 @@ class MockPosthogService extends _i1.Mock implements _i17.PosthogService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future createDialogEvent({ required String? name, @@ -1355,6 +1864,7 @@ class MockPosthogService extends _i1.Mock implements _i17.PosthogService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future createServiceEvent({ required String? name, @@ -1372,6 +1882,7 @@ class MockPosthogService extends _i1.Mock implements _i17.PosthogService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future createViewEvent({ required String? name, @@ -1389,6 +1900,7 @@ class MockPosthogService extends _i1.Mock implements _i17.PosthogService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future createWidgetEvent({ required String? name, @@ -1406,6 +1918,7 @@ class MockPosthogService extends _i1.Mock implements _i17.PosthogService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future deleteDialogEvent({ required String? name, @@ -1423,6 +1936,25 @@ class MockPosthogService extends _i1.Mock implements _i17.PosthogService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + + @override + _i6.Future deleteBottomsheetEvent({ + required String? name, + required List? arguments, + }) => + (super.noSuchMethod( + Invocation.method( + #deleteBottomsheetEvent, + [], + { + #name: name, + #arguments: arguments, + }, + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + @override _i6.Future deleteServiceEvent({ required String? name, @@ -1440,6 +1972,7 @@ class MockPosthogService extends _i1.Mock implements _i17.PosthogService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future deleteViewEvent({ required String? name, @@ -1457,6 +1990,7 @@ class MockPosthogService extends _i1.Mock implements _i17.PosthogService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future generateCodeEvent({required List? arguments}) => (super.noSuchMethod( @@ -1468,12 +2002,13 @@ class MockPosthogService extends _i1.Mock implements _i17.PosthogService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future logExceptionEvent({ - _i17.Level? level = _i17.Level.error, + _i18.Level? level = _i18.Level.error, required String? runtimeType, required String? message, - String? stackTrace = r'Not Available', + String? stackTrace = 'Not Available', }) => (super.noSuchMethod( Invocation.method( @@ -1489,6 +2024,7 @@ class MockPosthogService extends _i1.Mock implements _i17.PosthogService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future updateCliEvent() => (super.noSuchMethod( Invocation.method( @@ -1503,25 +2039,53 @@ class MockPosthogService extends _i1.Mock implements _i17.PosthogService { /// A class which mocks [PubService]. /// /// See the documentation for Mockito's code generation for more information. -class MockPubService extends _i1.Mock implements _i18.PubService { +class MockPubService extends _i1.Mock implements _i19.PubService { @override _i6.Future getCurrentVersion() => (super.noSuchMethod( Invocation.method( #getCurrentVersion, [], ), - returnValue: _i6.Future.value(''), - returnValueForMissingStub: _i6.Future.value(''), + returnValue: _i6.Future.value(_i8.dummyValue( + this, + Invocation.method( + #getCurrentVersion, + [], + ), + )), + returnValueForMissingStub: + _i6.Future.value(_i8.dummyValue( + this, + Invocation.method( + #getCurrentVersion, + [], + ), + )), ) as _i6.Future); + @override _i6.Future getLatestVersion() => (super.noSuchMethod( Invocation.method( #getLatestVersion, [], ), - returnValue: _i6.Future.value(''), - returnValueForMissingStub: _i6.Future.value(''), + returnValue: _i6.Future.value(_i8.dummyValue( + this, + Invocation.method( + #getLatestVersion, + [], + ), + )), + returnValueForMissingStub: + _i6.Future.value(_i8.dummyValue( + this, + Invocation.method( + #getLatestVersion, + [], + ), + )), ) as _i6.Future); + @override _i6.Future hasLatestVersion() => (super.noSuchMethod( Invocation.method( @@ -1531,21 +2095,23 @@ class MockPubService extends _i1.Mock implements _i18.PubService { returnValue: _i6.Future.value(false), returnValueForMissingStub: _i6.Future.value(false), ) as _i6.Future); + @override _i6.Future<_i2.ProcessResult> update() => (super.noSuchMethod( Invocation.method( #update, [], ), - returnValue: _i6.Future<_i2.ProcessResult>.value(_FakeProcessResult_3( + returnValue: _i6.Future<_i2.ProcessResult>.value( + _i8.dummyValue<_i2.ProcessResult>( this, Invocation.method( #update, [], ), )), - returnValueForMissingStub: - _i6.Future<_i2.ProcessResult>.value(_FakeProcessResult_3( + returnValueForMissingStub: _i6.Future<_i2.ProcessResult>.value( + _i8.dummyValue<_i2.ProcessResult>( this, Invocation.method( #update,