From 5bcdd127e25b269aea0b85ddc75a0e04f6d97fdc Mon Sep 17 00:00:00 2001 From: Pebkac03 Date: Tue, 10 Dec 2024 16:18:35 +0100 Subject: [PATCH 1/6] add offline_mode to model: Config --- lib/src/models/config_model.dart | 3 + lib/src/models/config_model.freezed.dart | 145 ++-- lib/src/models/config_model.g.dart | 9 +- lib/src/models/template_models.freezed.dart | 306 ++++--- lib/src/models/template_models.g.dart | 32 +- test/helpers/test_helpers.mocks.dart | 833 ++++++++++++++++---- 6 files changed, 999 insertions(+), 329 deletions(-) diff --git a/lib/src/models/config_model.dart b/lib/src/models/config_model.dart index 40f0420..b5258b6 100644 --- a/lib/src/models/config_model.dart +++ b/lib/src/models/config_model.dart @@ -93,6 +93,9 @@ class Config with _$Config { /// the code. @JsonKey(name: 'line_length') @Default(80) int lineLength, @JsonKey(name: 'prefer_web') @Default(false) bool preferWeb, + + /// Boolean value determining if build_runner should run pub get. + @JsonKey(name: 'offline_mode') @Default(false) bool offlineMode, }) = _Config; factory Config.fromJson(Map json) => _$ConfigFromJson(json); diff --git a/lib/src/models/config_model.freezed.dart b/lib/src/models/config_model.freezed.dart index a05d728..1639685 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,16 @@ mixin _$Config { @JsonKey(name: 'prefer_web') bool get preferWeb => throw _privateConstructorUsedError; + /// Boolean value determining if build_runner should run pub get. + @JsonKey(name: 'offline_mode') + bool get offlineMode => 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; } @@ -132,7 +140,8 @@ abstract class $ConfigCopyWith<$Res> { @JsonKey(name: 'register_mocks_function') String registerMocksFunction, @JsonKey(name: 'v1') bool v1, @JsonKey(name: 'line_length') int lineLength, - @JsonKey(name: 'prefer_web') bool preferWeb}); + @JsonKey(name: 'prefer_web') bool preferWeb, + @JsonKey(name: 'offline_mode') bool offlineMode}); } /// @nodoc @@ -145,6 +154,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({ @@ -167,6 +178,7 @@ class _$ConfigCopyWithImpl<$Res, $Val extends Config> Object? v1 = null, Object? lineLength = null, Object? preferWeb = null, + Object? offlineMode = null, }) { return _then(_value.copyWith( viewsPath: null == viewsPath @@ -245,14 +257,19 @@ class _$ConfigCopyWithImpl<$Res, $Val extends Config> ? _value.preferWeb : preferWeb // ignore: cast_nullable_to_non_nullable as bool, + offlineMode: null == offlineMode + ? _value.offlineMode + : offlineMode // ignore: cast_nullable_to_non_nullable + as bool, ) as $Val); } } /// @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( @@ -276,16 +293,20 @@ abstract class _$$_ConfigCopyWith<$Res> implements $ConfigCopyWith<$Res> { @JsonKey(name: 'register_mocks_function') String registerMocksFunction, @JsonKey(name: 'v1') bool v1, @JsonKey(name: 'line_length') int lineLength, - @JsonKey(name: 'prefer_web') bool preferWeb}); + @JsonKey(name: 'prefer_web') bool preferWeb, + @JsonKey(name: 'offline_mode') bool offlineMode}); } /// @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({ @@ -308,8 +329,9 @@ class __$$_ConfigCopyWithImpl<$Res> Object? v1 = null, Object? lineLength = null, Object? preferWeb = null, + Object? offlineMode = null, }) { - return _then(_$_Config( + return _then(_$ConfigImpl( viewsPath: null == viewsPath ? _value.viewsPath : viewsPath // ignore: cast_nullable_to_non_nullable @@ -386,14 +408,18 @@ class __$$_ConfigCopyWithImpl<$Res> ? _value.preferWeb : preferWeb // ignore: cast_nullable_to_non_nullable as bool, + offlineMode: null == offlineMode + ? _value.offlineMode + : offlineMode // ignore: cast_nullable_to_non_nullable + as bool, )); } } /// @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', @@ -421,10 +447,11 @@ class _$_Config implements _Config { this.registerMocksFunction = 'registerServices', @JsonKey(name: 'v1') this.v1 = false, @JsonKey(name: 'line_length') this.lineLength = 80, - @JsonKey(name: 'prefer_web') this.preferWeb = false}); + @JsonKey(name: 'prefer_web') this.preferWeb = false, + @JsonKey(name: 'offline_mode') this.offlineMode = false}); - factory _$_Config.fromJson(Map json) => - _$$_ConfigFromJson(json); + factory _$ConfigImpl.fromJson(Map json) => + _$$ConfigImplFromJson(json); /// Path where views and viewmodels will be genereated. @override @@ -526,16 +553,21 @@ class _$_Config implements _Config { @JsonKey(name: 'prefer_web') final bool preferWeb; + /// Boolean value determining if build_runner should run pub get. + @override + @JsonKey(name: 'offline_mode') + final bool offlineMode; + @override String toString() { - return 'Config(viewsPath: $viewsPath, servicesPath: $servicesPath, widgetsPath: $widgetsPath, bottomSheetsPath: $bottomSheetsPath, bottomSheetTypeFilePath: $bottomSheetTypeFilePath, bottomSheetBuilderFilePath: $bottomSheetBuilderFilePath, dialogsPath: $dialogsPath, dialogTypeFilePath: $dialogTypeFilePath, dialogBuilderFilePath: $dialogBuilderFilePath, stackedAppFilePath: $stackedAppFilePath, testHelpersFilePath: $testHelpersFilePath, testServicesPath: $testServicesPath, testViewsPath: $testViewsPath, testWidgetsPath: $testWidgetsPath, locatorName: $locatorName, registerMocksFunction: $registerMocksFunction, v1: $v1, lineLength: $lineLength, preferWeb: $preferWeb)'; + return 'Config(viewsPath: $viewsPath, servicesPath: $servicesPath, widgetsPath: $widgetsPath, bottomSheetsPath: $bottomSheetsPath, bottomSheetTypeFilePath: $bottomSheetTypeFilePath, bottomSheetBuilderFilePath: $bottomSheetBuilderFilePath, dialogsPath: $dialogsPath, dialogTypeFilePath: $dialogTypeFilePath, dialogBuilderFilePath: $dialogBuilderFilePath, stackedAppFilePath: $stackedAppFilePath, testHelpersFilePath: $testHelpersFilePath, testServicesPath: $testServicesPath, testViewsPath: $testViewsPath, testWidgetsPath: $testWidgetsPath, locatorName: $locatorName, registerMocksFunction: $registerMocksFunction, v1: $v1, lineLength: $lineLength, preferWeb: $preferWeb, offlineMode: $offlineMode)'; } @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) || @@ -575,10 +607,12 @@ class _$_Config implements _Config { (identical(other.lineLength, lineLength) || other.lineLength == lineLength) && (identical(other.preferWeb, preferWeb) || - other.preferWeb == preferWeb)); + other.preferWeb == preferWeb) && + (identical(other.offlineMode, offlineMode) || + other.offlineMode == offlineMode)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hashAll([ runtimeType, @@ -600,18 +634,21 @@ class _$_Config implements _Config { registerMocksFunction, v1, lineLength, - preferWeb + preferWeb, + offlineMode ]); - @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 +678,120 @@ 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; + @JsonKey(name: 'prefer_web') final bool preferWeb, + @JsonKey(name: 'offline_mode') final bool offlineMode}) = _$ConfigImpl; - factory _Config.fromJson(Map json) = _$_Config.fromJson; - - @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; + + /// Boolean value determining if build_runner should run pub get. + @override + @JsonKey(name: 'offline_mode') + bool get offlineMode; + + /// 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..ba444c3 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,13 @@ _$_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, + offlineMode: json['offline_mode'] as bool? ?? false, ); -Map _$$_ConfigToJson(_$_Config instance) => { +Map _$$ConfigImplToJson(_$ConfigImpl instance) => + { 'views_path': instance.viewsPath, 'services_path': instance.servicesPath, 'widgets_path': instance.widgetsPath, @@ -57,4 +59,5 @@ Map _$$_ConfigToJson(_$_Config instance) => { 'v1': instance.v1, 'line_length': instance.lineLength, 'prefer_web': instance.preferWeb, + 'offline_mode': instance.offlineMode, }; 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/test/helpers/test_helpers.mocks.dart b/test/helpers/test_helpers.mocks.dart index 1ea99ea..0d769b5 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.4 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,25 +9,28 @@ 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: prefer_const_constructors @@ -67,16 +68,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 +97,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 +123,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 +141,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 +153,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 +165,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 +174,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 +205,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,6 +217,7 @@ 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, @@ -223,6 +237,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 +255,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 +273,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 +288,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 +306,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 +345,7 @@ class MockPathService extends _i1.Mock implements _i8.PathService { Invocation.getter(#configHome), ), ) as _i2.Directory); + @override String join( String? part1, [ @@ -338,24 +371,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 +441,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, @@ -394,9 +471,10 @@ class MockTemplateService extends _i1.Mock implements _i9.TemplateService { 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, @@ -419,6 +497,7 @@ class MockTemplateService extends _i1.Mock implements _i9.TemplateService { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override String getTemplateOutputPath({ required String? inputTemplatePath, @@ -435,9 +514,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 +556,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 +601,7 @@ class MockTemplateService extends _i1.Mock implements _i9.TemplateService { returnValue: {}, returnValueForMissingStub: {}, ) as Map); + @override Map applyGlobalTemplateProperties( Map? renderTemplate, { @@ -490,9 +616,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 +638,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 +655,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 +701,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 +745,20 @@ 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 set packageDescription(String? _packageDescription) => super.noSuchMethod( Invocation.setter( @@ -582,12 +767,20 @@ class MockTemplateHelper extends _i1.Mock implements _i12.TemplateHelper { ), returnValueForMissingStub: null, ); + @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 List<_i2.FileSystemEntity> getFilesWithExtension({ required List<_i2.FileSystemEntity>? filePaths, @@ -605,6 +798,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 +816,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 +826,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 +852,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,6 +882,7 @@ 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, @@ -678,8 +904,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 +920,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 +941,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 +965,7 @@ class MockPubspecService extends _i1.Mock implements _i13.PubspecService { Invocation.getter(#pubspecYaml), ), ) as _i3.PubspecYaml); + @override set pubspecYaml(_i3.PubspecYaml? _pubspecYaml) => super.noSuchMethod( Invocation.setter( @@ -745,12 +974,20 @@ class MockPubspecService extends _i1.Mock implements _i13.PubspecService { ), returnValueForMissingStub: null, ); + @override String get getPackageName => (super.noSuchMethod( Invocation.getter(#getPackageName), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i8.dummyValue( + this, + Invocation.getter(#getPackageName), + ), + returnValueForMissingStub: _i8.dummyValue( + this, + Invocation.getter(#getPackageName), + ), ) as String); + @override _i6.Future initialise({String? workingDirectory}) => (super.noSuchMethod( @@ -768,7 +1005,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 +1018,7 @@ class MockColorizedLogService extends _i1.Mock Invocation.getter(#pen), ), ) as _i4.AnsiPen); + @override set pen(_i4.AnsiPen? _pen) => super.noSuchMethod( Invocation.setter( @@ -789,6 +1027,7 @@ class MockColorizedLogService extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void coloredPrint( _i4.AnsiPen? pen, { @@ -802,6 +1041,7 @@ class MockColorizedLogService extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void fileOutput({ required _i5.FileModificationType? type, @@ -818,6 +1058,7 @@ class MockColorizedLogService extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void flutterOutput({required String? message}) => super.noSuchMethod( Invocation.method( @@ -827,6 +1068,7 @@ class MockColorizedLogService extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void stackedOutput({ required String? message, @@ -843,6 +1085,7 @@ class MockColorizedLogService extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void success({required String? message}) => super.noSuchMethod( Invocation.method( @@ -852,6 +1095,7 @@ class MockColorizedLogService extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void warn({required String? message}) => super.noSuchMethod( Invocation.method( @@ -861,6 +1105,7 @@ class MockColorizedLogService extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void info({required String? message}) => super.noSuchMethod( Invocation.method( @@ -870,6 +1115,7 @@ class MockColorizedLogService extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void error({required String? message}) => super.noSuchMethod( Invocation.method( @@ -884,151 +1130,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 +1430,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 +1448,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 +1457,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 +1490,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,15 +1524,29 @@ 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, [ @@ -1116,27 +1560,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 +1639,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 +1648,7 @@ class MockProcessService extends _i1.Mock implements _i16.ProcessService { ), returnValueForMissingStub: null, ); + @override _i6.Future runCreateApp({ required String? name, @@ -1180,6 +1670,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 +1690,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 +1701,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 +1719,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 +1729,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 +1739,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 +1750,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 +1764,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 +1795,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 +1805,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 +1823,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 +1841,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 +1859,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 +1877,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 +1895,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 +1913,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 +1931,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 +1967,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 +1985,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,9 +1997,10 @@ 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', @@ -1489,6 +2019,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 +2034,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 +2090,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, From 22a8877947e9466a98da03e9dbde99776724bfdc Mon Sep 17 00:00:00 2001 From: Pebkac03 Date: Tue, 10 Dec 2024 16:24:39 +0100 Subject: [PATCH 2/6] added offlineMode getter to config_service --- lib/src/services/config_service.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/src/services/config_service.dart b/lib/src/services/config_service.dart index 32c4f18..77397c8 100644 --- a/lib/src/services/config_service.dart +++ b/lib/src/services/config_service.dart @@ -100,6 +100,12 @@ class ConfigService { /// True: ViewModelBuilder bool get v1 => _customConfig.v1; + /// Returns boolean value to determine if build_runner should run pub get. + /// + /// False: pub get should run + /// True: pub get should not run + bool get offlineMode => _customConfig.offlineMode; + /// Returns int value for line length when format code. int get lineLength => _customConfig.lineLength; From cebf7c1817eb0fa62cf9840c53ff3402b9df1731 Mon Sep 17 00:00:00 2001 From: Pebkac03 Date: Tue, 10 Dec 2024 16:30:37 +0100 Subject: [PATCH 3/6] added ksNoPubGet constant --- lib/src/constants/command_constants.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/src/constants/command_constants.dart b/lib/src/constants/command_constants.dart index 8a9845e..520dde0 100644 --- a/lib/src/constants/command_constants.dart +++ b/lib/src/constants/command_constants.dart @@ -1,4 +1,5 @@ /// Stores all the commands used throughout the app that +library; const String ksDart = 'dart'; const String ksFlutter = 'flutter'; @@ -11,6 +12,7 @@ const String ksBuild = 'build'; const String ksBuildRunner = 'build_runner'; const String ksDeleteConflictOutputs = 'delete-conflicting-outputs'; const String ksDeleteConflictingOutputs = '--delete-conflicting-outputs'; +const String ksNoPubGet = '--no-pub'; const String ksVersion = 'version'; const String ksEnableAnalytics = 'enable-analytics'; const String ksDisableAnalytics = 'disable-analytics'; From 5071f585765e7653355a045de37eb53a0b65808f Mon Sep 17 00:00:00 2001 From: Pebkac03 Date: Tue, 10 Dec 2024 16:39:48 +0100 Subject: [PATCH 4/6] added offlineMode to process_service runBuildRunner --- lib/src/services/process_service.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/src/services/process_service.dart b/lib/src/services/process_service.dart index a400ed3..d01e6c8 100644 --- a/lib/src/services/process_service.dart +++ b/lib/src/services/process_service.dart @@ -13,9 +13,11 @@ class ProcessService { final _configService = locator(); late String _formattingLineLength; + late bool _offlineMode; ProcessService() { _formattingLineLength = _configService.lineLength.toString(); + _offlineMode = _configService.offlineMode; } set formattingLineLength(String? length) { @@ -64,6 +66,7 @@ class ProcessService { ...buildRunnerArguments, shouldWatch ? ksWatch : ksBuild, if (shouldDeleteConflictingOutputs) ksDeleteConflictingOutputs, + if (_offlineMode) ksNoPubGet, ], workingDirectory: workingDirectory, ); From 91be2511d4670898e415b9f558d9fc02d8d95c68 Mon Sep 17 00:00:00 2001 From: Pebkac03 Date: Tue, 10 Dec 2024 17:10:47 +0100 Subject: [PATCH 5/6] updated tests --- test/helpers/test_helpers.dart | 3 +++ test/helpers/test_helpers.mocks.dart | 7 +++++++ test/services/config_service_test.dart | 1 + 3 files changed, 11 insertions(+) diff --git a/test/helpers/test_helpers.dart b/test/helpers/test_helpers.dart index 6f66e7d..8dd5232 100644 --- a/test/helpers/test_helpers.dart +++ b/test/helpers/test_helpers.dart @@ -15,6 +15,7 @@ import 'package:stacked_cli/src/services/pub_service.dart'; import 'package:stacked_cli/src/services/pubspec_service.dart'; import 'package:stacked_cli/src/services/template_service.dart'; import 'package:stacked_cli/src/templates/template_helper.dart'; + // @stacked-import import '../test_constants.dart'; @@ -153,6 +154,7 @@ MockConfigService getAndRegisterConfigService({ String locatorName = 'locator', String registerMocksFunction = 'registerServices', bool v1 = false, + bool offlineMode = false, int lineLength = 80, }) { _removeRegistrationIfExists(); @@ -168,6 +170,7 @@ MockConfigService getAndRegisterConfigService({ when(service.locatorName).thenReturn(locatorName); when(service.registerMocksFunction).thenReturn(registerMocksFunction); when(service.v1).thenReturn(v1); + when(service.offlineMode).thenReturn(offlineMode); when(service.lineLength).thenReturn(lineLength); when(service.replaceCustomPaths(any)).thenAnswer( diff --git a/test/helpers/test_helpers.mocks.dart b/test/helpers/test_helpers.mocks.dart index 0d769b5..4da3b39 100644 --- a/test/helpers/test_helpers.mocks.dart +++ b/test/helpers/test_helpers.mocks.dart @@ -1405,6 +1405,13 @@ class MockConfigService extends _i1.Mock implements _i16.ConfigService { returnValueForMissingStub: false, ) as bool); + @override + bool get offlineMode => (super.noSuchMethod( + Invocation.getter(#offlineMode), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + @override int get lineLength => (super.noSuchMethod( Invocation.getter(#lineLength), diff --git a/test/services/config_service_test.dart b/test/services/config_service_test.dart index 3243612..4d89d36 100644 --- a/test/services/config_service_test.dart +++ b/test/services/config_service_test.dart @@ -41,6 +41,7 @@ void main() { "test_views_path": "my/personal/path/to/tests/viewmodel", "test_widgets_path": "my/personal/path/to/tests/widget_models", "v1": false, + "offline_mode": false, "views_path": "my/personal/path/to/views", "widgets_path": "ui/widgets/common" }); From a83f293c382c253201aaa558f24df0ba2587a880 Mon Sep 17 00:00:00 2001 From: Pebkac03 Date: Tue, 10 Dec 2024 17:11:06 +0100 Subject: [PATCH 6/6] updated templates --- lib/src/templates/app/mobile/stacked.json.stk | 1 + lib/src/templates/app/web/stacked.json.stk | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/src/templates/app/mobile/stacked.json.stk b/lib/src/templates/app/mobile/stacked.json.stk index 877b4be..fd631b9 100644 --- a/lib/src/templates/app/mobile/stacked.json.stk +++ b/lib/src/templates/app/mobile/stacked.json.stk @@ -12,6 +12,7 @@ "test_views_path": "viewmodels", "test_widgets_path": "widget_models", "v1": false, + "offline_mode": false, "views_path": "ui/views", "widgets_path": "ui/widgets/common" } \ No newline at end of file diff --git a/lib/src/templates/app/web/stacked.json.stk b/lib/src/templates/app/web/stacked.json.stk index 39f632e..bb18cf9 100644 --- a/lib/src/templates/app/web/stacked.json.stk +++ b/lib/src/templates/app/web/stacked.json.stk @@ -12,6 +12,7 @@ "test_views_path": "viewmodels", "test_widgets_path": "widget_models", "v1": false, + "offline_mode": false, "views_path": "ui/views", "widgets_path": "ui/widgets/common" } \ No newline at end of file