diff --git a/packages/_internal/lib/models.dart b/packages/_internal/lib/models.dart index be0a2673..7046bdf5 100644 --- a/packages/_internal/lib/models.dart +++ b/packages/_internal/lib/models.dart @@ -25,14 +25,14 @@ String constructorNameToCallbackName(String name) => name; /// This allows Freezed to support deep copy of the object. /// This does include primitives like [int] and [List]. @freezed -class CloneableProperty with _$CloneableProperty { - factory CloneableProperty({ +class DeepCloneableProperty with _$DeepCloneableProperty { + factory DeepCloneableProperty({ required String name, required String typeName, required String type, required bool nullable, required GenericsParameterTemplate genericParameters, - }) = _CloneableProperty; + }) = _DeepCloneableProperty; } /// The information of a specific constructor of a class tagged with `@freezed`. @@ -55,7 +55,7 @@ class ConstructorDetails with _$ConstructorDetails { required List withDecorators, required List implementsDecorators, required List decorators, - required List cloneableProperties, + required List cloneableProperties, required List asserts, }) = _ConstructorDetails; diff --git a/packages/_internal/lib/models.freezed.dart b/packages/_internal/lib/models.freezed.dart index 85eb285a..e182134d 100644 --- a/packages/_internal/lib/models.freezed.dart +++ b/packages/_internal/lib/models.freezed.dart @@ -1,5 +1,6 @@ // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target part of 'models.dart'; @@ -14,30 +15,7 @@ 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'); /// @nodoc -class _$CloneablePropertyTearOff { - const _$CloneablePropertyTearOff(); - - _CloneableProperty call( - {required String name, - required String typeName, - required String type, - required bool nullable, - required GenericsParameterTemplate genericParameters}) { - return _CloneableProperty( - name: name, - typeName: typeName, - type: type, - nullable: nullable, - genericParameters: genericParameters, - ); - } -} - -/// @nodoc -const $CloneableProperty = _$CloneablePropertyTearOff(); - -/// @nodoc -mixin _$CloneableProperty { +mixin _$DeepCloneableProperty { String get name => throw _privateConstructorUsedError; String get typeName => throw _privateConstructorUsedError; String get type => throw _privateConstructorUsedError; @@ -46,15 +24,16 @@ mixin _$CloneableProperty { throw _privateConstructorUsedError; @JsonKey(ignore: true) - $CloneablePropertyCopyWith get copyWith => + $DeepCloneablePropertyCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $CloneablePropertyCopyWith<$Res> { - factory $CloneablePropertyCopyWith( - CloneableProperty value, $Res Function(CloneableProperty) then) = - _$CloneablePropertyCopyWithImpl<$Res>; +abstract class $DeepCloneablePropertyCopyWith<$Res> { + factory $DeepCloneablePropertyCopyWith(DeepCloneableProperty value, + $Res Function(DeepCloneableProperty) then) = + _$DeepCloneablePropertyCopyWithImpl<$Res, DeepCloneableProperty>; + @useResult $Res call( {String name, String typeName, @@ -64,54 +43,58 @@ abstract class $CloneablePropertyCopyWith<$Res> { } /// @nodoc -class _$CloneablePropertyCopyWithImpl<$Res> - implements $CloneablePropertyCopyWith<$Res> { - _$CloneablePropertyCopyWithImpl(this._value, this._then); +class _$DeepCloneablePropertyCopyWithImpl<$Res, + $Val extends DeepCloneableProperty> + implements $DeepCloneablePropertyCopyWith<$Res> { + _$DeepCloneablePropertyCopyWithImpl(this._value, this._then); - final CloneableProperty _value; // ignore: unused_field - final $Res Function(CloneableProperty) _then; + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + @pragma('vm:prefer-inline') @override $Res call({ - Object? name = freezed, - Object? typeName = freezed, - Object? type = freezed, - Object? nullable = freezed, - Object? genericParameters = freezed, + Object? name = null, + Object? typeName = null, + Object? type = null, + Object? nullable = null, + Object? genericParameters = null, }) { return _then(_value.copyWith( - name: name == freezed + name: null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, - typeName: typeName == freezed + typeName: null == typeName ? _value.typeName : typeName // ignore: cast_nullable_to_non_nullable as String, - type: type == freezed + type: null == type ? _value.type : type // ignore: cast_nullable_to_non_nullable as String, - nullable: nullable == freezed + nullable: null == nullable ? _value.nullable : nullable // ignore: cast_nullable_to_non_nullable as bool, - genericParameters: genericParameters == freezed + genericParameters: null == genericParameters ? _value.genericParameters : genericParameters // ignore: cast_nullable_to_non_nullable as GenericsParameterTemplate, - )); + ) as $Val); } } /// @nodoc -abstract class _$CloneablePropertyCopyWith<$Res> - implements $CloneablePropertyCopyWith<$Res> { - factory _$CloneablePropertyCopyWith( - _CloneableProperty value, $Res Function(_CloneableProperty) then) = - __$CloneablePropertyCopyWithImpl<$Res>; +abstract class _$$_DeepCloneablePropertyCopyWith<$Res> + implements $DeepCloneablePropertyCopyWith<$Res> { + factory _$$_DeepCloneablePropertyCopyWith(_$_DeepCloneableProperty value, + $Res Function(_$_DeepCloneableProperty) then) = + __$$_DeepCloneablePropertyCopyWithImpl<$Res>; @override + @useResult $Res call( {String name, String typeName, @@ -121,42 +104,40 @@ abstract class _$CloneablePropertyCopyWith<$Res> } /// @nodoc -class __$CloneablePropertyCopyWithImpl<$Res> - extends _$CloneablePropertyCopyWithImpl<$Res> - implements _$CloneablePropertyCopyWith<$Res> { - __$CloneablePropertyCopyWithImpl( - _CloneableProperty _value, $Res Function(_CloneableProperty) _then) - : super(_value, (v) => _then(v as _CloneableProperty)); - - @override - _CloneableProperty get _value => super._value as _CloneableProperty; +class __$$_DeepCloneablePropertyCopyWithImpl<$Res> + extends _$DeepCloneablePropertyCopyWithImpl<$Res, _$_DeepCloneableProperty> + implements _$$_DeepCloneablePropertyCopyWith<$Res> { + __$$_DeepCloneablePropertyCopyWithImpl(_$_DeepCloneableProperty _value, + $Res Function(_$_DeepCloneableProperty) _then) + : super(_value, _then); + @pragma('vm:prefer-inline') @override $Res call({ - Object? name = freezed, - Object? typeName = freezed, - Object? type = freezed, - Object? nullable = freezed, - Object? genericParameters = freezed, + Object? name = null, + Object? typeName = null, + Object? type = null, + Object? nullable = null, + Object? genericParameters = null, }) { - return _then(_CloneableProperty( - name: name == freezed + return _then(_$_DeepCloneableProperty( + name: null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, - typeName: typeName == freezed + typeName: null == typeName ? _value.typeName : typeName // ignore: cast_nullable_to_non_nullable as String, - type: type == freezed + type: null == type ? _value.type : type // ignore: cast_nullable_to_non_nullable as String, - nullable: nullable == freezed + nullable: null == nullable ? _value.nullable : nullable // ignore: cast_nullable_to_non_nullable as bool, - genericParameters: genericParameters == freezed + genericParameters: null == genericParameters ? _value.genericParameters : genericParameters // ignore: cast_nullable_to_non_nullable as GenericsParameterTemplate, @@ -166,8 +147,8 @@ class __$CloneablePropertyCopyWithImpl<$Res> /// @nodoc -class _$_CloneableProperty implements _CloneableProperty { - _$_CloneableProperty( +class _$_DeepCloneableProperty implements _DeepCloneableProperty { + _$_DeepCloneableProperty( {required this.name, required this.typeName, required this.type, @@ -187,14 +168,14 @@ class _$_CloneableProperty implements _CloneableProperty { @override String toString() { - return 'CloneableProperty(name: $name, typeName: $typeName, type: $type, nullable: $nullable, genericParameters: $genericParameters)'; + return 'DeepCloneableProperty(name: $name, typeName: $typeName, type: $type, nullable: $nullable, genericParameters: $genericParameters)'; } @override bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _CloneableProperty && + other is _$_DeepCloneableProperty && (identical(other.name, name) || other.name == name) && (identical(other.typeName, typeName) || other.typeName == typeName) && @@ -211,18 +192,20 @@ class _$_CloneableProperty implements _CloneableProperty { @JsonKey(ignore: true) @override - _$CloneablePropertyCopyWith<_CloneableProperty> get copyWith => - __$CloneablePropertyCopyWithImpl<_CloneableProperty>(this, _$identity); + @pragma('vm:prefer-inline') + _$$_DeepCloneablePropertyCopyWith<_$_DeepCloneableProperty> get copyWith => + __$$_DeepCloneablePropertyCopyWithImpl<_$_DeepCloneableProperty>( + this, _$identity); } -abstract class _CloneableProperty implements CloneableProperty { - factory _CloneableProperty( - {required String name, - required String typeName, - required String type, - required bool nullable, - required GenericsParameterTemplate genericParameters}) = - _$_CloneableProperty; +abstract class _DeepCloneableProperty implements DeepCloneableProperty { + factory _DeepCloneableProperty( + {required final String name, + required final String typeName, + required final String type, + required final bool nullable, + required final GenericsParameterTemplate genericParameters}) = + _$_DeepCloneableProperty; @override String get name; @@ -236,55 +219,10 @@ abstract class _CloneableProperty implements CloneableProperty { GenericsParameterTemplate get genericParameters; @override @JsonKey(ignore: true) - _$CloneablePropertyCopyWith<_CloneableProperty> get copyWith => + _$$_DeepCloneablePropertyCopyWith<_$_DeepCloneableProperty> get copyWith => throw _privateConstructorUsedError; } -/// @nodoc -class _$ConstructorDetailsTearOff { - const _$ConstructorDetailsTearOff(); - - _ConstructorDetails call( - {required String name, - required String unionValue, - required bool isConst, - required String redirectedName, - required ParametersTemplate parameters, - required List impliedProperties, - required bool isDefault, - required bool isFallback, - required bool hasJsonSerializable, - required String fullName, - required String escapedName, - required List withDecorators, - required List implementsDecorators, - required List decorators, - required List cloneableProperties, - required List asserts}) { - return _ConstructorDetails( - name: name, - unionValue: unionValue, - isConst: isConst, - redirectedName: redirectedName, - parameters: parameters, - impliedProperties: impliedProperties, - isDefault: isDefault, - isFallback: isFallback, - hasJsonSerializable: hasJsonSerializable, - fullName: fullName, - escapedName: escapedName, - withDecorators: withDecorators, - implementsDecorators: implementsDecorators, - decorators: decorators, - cloneableProperties: cloneableProperties, - asserts: asserts, - ); - } -} - -/// @nodoc -const $ConstructorDetails = _$ConstructorDetailsTearOff(); - /// @nodoc mixin _$ConstructorDetails { String get name => throw _privateConstructorUsedError; @@ -301,7 +239,7 @@ mixin _$ConstructorDetails { List get withDecorators => throw _privateConstructorUsedError; List get implementsDecorators => throw _privateConstructorUsedError; List get decorators => throw _privateConstructorUsedError; - List get cloneableProperties => + List get cloneableProperties => throw _privateConstructorUsedError; List get asserts => throw _privateConstructorUsedError; @@ -314,7 +252,8 @@ mixin _$ConstructorDetails { abstract class $ConstructorDetailsCopyWith<$Res> { factory $ConstructorDetailsCopyWith( ConstructorDetails value, $Res Function(ConstructorDetails) then) = - _$ConstructorDetailsCopyWithImpl<$Res>; + _$ConstructorDetailsCopyWithImpl<$Res, ConstructorDetails>; + @useResult $Res call( {String name, String unionValue, @@ -330,114 +269,117 @@ abstract class $ConstructorDetailsCopyWith<$Res> { List withDecorators, List implementsDecorators, List decorators, - List cloneableProperties, + List cloneableProperties, List asserts}); } /// @nodoc -class _$ConstructorDetailsCopyWithImpl<$Res> +class _$ConstructorDetailsCopyWithImpl<$Res, $Val extends ConstructorDetails> implements $ConstructorDetailsCopyWith<$Res> { _$ConstructorDetailsCopyWithImpl(this._value, this._then); - final ConstructorDetails _value; // ignore: unused_field - final $Res Function(ConstructorDetails) _then; + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + @pragma('vm:prefer-inline') @override $Res call({ - Object? name = freezed, - Object? unionValue = freezed, - Object? isConst = freezed, - Object? redirectedName = freezed, - Object? parameters = freezed, - Object? impliedProperties = freezed, - Object? isDefault = freezed, - Object? isFallback = freezed, - Object? hasJsonSerializable = freezed, - Object? fullName = freezed, - Object? escapedName = freezed, - Object? withDecorators = freezed, - Object? implementsDecorators = freezed, - Object? decorators = freezed, - Object? cloneableProperties = freezed, - Object? asserts = freezed, + Object? name = null, + Object? unionValue = null, + Object? isConst = null, + Object? redirectedName = null, + Object? parameters = null, + Object? impliedProperties = null, + Object? isDefault = null, + Object? isFallback = null, + Object? hasJsonSerializable = null, + Object? fullName = null, + Object? escapedName = null, + Object? withDecorators = null, + Object? implementsDecorators = null, + Object? decorators = null, + Object? cloneableProperties = null, + Object? asserts = null, }) { return _then(_value.copyWith( - name: name == freezed + name: null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, - unionValue: unionValue == freezed + unionValue: null == unionValue ? _value.unionValue : unionValue // ignore: cast_nullable_to_non_nullable as String, - isConst: isConst == freezed + isConst: null == isConst ? _value.isConst : isConst // ignore: cast_nullable_to_non_nullable as bool, - redirectedName: redirectedName == freezed + redirectedName: null == redirectedName ? _value.redirectedName : redirectedName // ignore: cast_nullable_to_non_nullable as String, - parameters: parameters == freezed + parameters: null == parameters ? _value.parameters : parameters // ignore: cast_nullable_to_non_nullable as ParametersTemplate, - impliedProperties: impliedProperties == freezed + impliedProperties: null == impliedProperties ? _value.impliedProperties : impliedProperties // ignore: cast_nullable_to_non_nullable as List, - isDefault: isDefault == freezed + isDefault: null == isDefault ? _value.isDefault : isDefault // ignore: cast_nullable_to_non_nullable as bool, - isFallback: isFallback == freezed + isFallback: null == isFallback ? _value.isFallback : isFallback // ignore: cast_nullable_to_non_nullable as bool, - hasJsonSerializable: hasJsonSerializable == freezed + hasJsonSerializable: null == hasJsonSerializable ? _value.hasJsonSerializable : hasJsonSerializable // ignore: cast_nullable_to_non_nullable as bool, - fullName: fullName == freezed + fullName: null == fullName ? _value.fullName : fullName // ignore: cast_nullable_to_non_nullable as String, - escapedName: escapedName == freezed + escapedName: null == escapedName ? _value.escapedName : escapedName // ignore: cast_nullable_to_non_nullable as String, - withDecorators: withDecorators == freezed + withDecorators: null == withDecorators ? _value.withDecorators : withDecorators // ignore: cast_nullable_to_non_nullable as List, - implementsDecorators: implementsDecorators == freezed + implementsDecorators: null == implementsDecorators ? _value.implementsDecorators : implementsDecorators // ignore: cast_nullable_to_non_nullable as List, - decorators: decorators == freezed + decorators: null == decorators ? _value.decorators : decorators // ignore: cast_nullable_to_non_nullable as List, - cloneableProperties: cloneableProperties == freezed + cloneableProperties: null == cloneableProperties ? _value.cloneableProperties : cloneableProperties // ignore: cast_nullable_to_non_nullable - as List, - asserts: asserts == freezed + as List, + asserts: null == asserts ? _value.asserts : asserts // ignore: cast_nullable_to_non_nullable as List, - )); + ) as $Val); } } /// @nodoc -abstract class _$ConstructorDetailsCopyWith<$Res> +abstract class _$$_ConstructorDetailsCopyWith<$Res> implements $ConstructorDetailsCopyWith<$Res> { - factory _$ConstructorDetailsCopyWith( - _ConstructorDetails value, $Res Function(_ConstructorDetails) then) = - __$ConstructorDetailsCopyWithImpl<$Res>; + factory _$$_ConstructorDetailsCopyWith(_$_ConstructorDetails value, + $Res Function(_$_ConstructorDetails) then) = + __$$_ConstructorDetailsCopyWithImpl<$Res>; @override + @useResult $Res call( {String name, String unionValue, @@ -453,103 +395,101 @@ abstract class _$ConstructorDetailsCopyWith<$Res> List withDecorators, List implementsDecorators, List decorators, - List cloneableProperties, + List cloneableProperties, List asserts}); } /// @nodoc -class __$ConstructorDetailsCopyWithImpl<$Res> - extends _$ConstructorDetailsCopyWithImpl<$Res> - implements _$ConstructorDetailsCopyWith<$Res> { - __$ConstructorDetailsCopyWithImpl( - _ConstructorDetails _value, $Res Function(_ConstructorDetails) _then) - : super(_value, (v) => _then(v as _ConstructorDetails)); - - @override - _ConstructorDetails get _value => super._value as _ConstructorDetails; +class __$$_ConstructorDetailsCopyWithImpl<$Res> + extends _$ConstructorDetailsCopyWithImpl<$Res, _$_ConstructorDetails> + implements _$$_ConstructorDetailsCopyWith<$Res> { + __$$_ConstructorDetailsCopyWithImpl( + _$_ConstructorDetails _value, $Res Function(_$_ConstructorDetails) _then) + : super(_value, _then); + @pragma('vm:prefer-inline') @override $Res call({ - Object? name = freezed, - Object? unionValue = freezed, - Object? isConst = freezed, - Object? redirectedName = freezed, - Object? parameters = freezed, - Object? impliedProperties = freezed, - Object? isDefault = freezed, - Object? isFallback = freezed, - Object? hasJsonSerializable = freezed, - Object? fullName = freezed, - Object? escapedName = freezed, - Object? withDecorators = freezed, - Object? implementsDecorators = freezed, - Object? decorators = freezed, - Object? cloneableProperties = freezed, - Object? asserts = freezed, + Object? name = null, + Object? unionValue = null, + Object? isConst = null, + Object? redirectedName = null, + Object? parameters = null, + Object? impliedProperties = null, + Object? isDefault = null, + Object? isFallback = null, + Object? hasJsonSerializable = null, + Object? fullName = null, + Object? escapedName = null, + Object? withDecorators = null, + Object? implementsDecorators = null, + Object? decorators = null, + Object? cloneableProperties = null, + Object? asserts = null, }) { - return _then(_ConstructorDetails( - name: name == freezed + return _then(_$_ConstructorDetails( + name: null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, - unionValue: unionValue == freezed + unionValue: null == unionValue ? _value.unionValue : unionValue // ignore: cast_nullable_to_non_nullable as String, - isConst: isConst == freezed + isConst: null == isConst ? _value.isConst : isConst // ignore: cast_nullable_to_non_nullable as bool, - redirectedName: redirectedName == freezed + redirectedName: null == redirectedName ? _value.redirectedName : redirectedName // ignore: cast_nullable_to_non_nullable as String, - parameters: parameters == freezed + parameters: null == parameters ? _value.parameters : parameters // ignore: cast_nullable_to_non_nullable as ParametersTemplate, - impliedProperties: impliedProperties == freezed - ? _value.impliedProperties + impliedProperties: null == impliedProperties + ? _value._impliedProperties : impliedProperties // ignore: cast_nullable_to_non_nullable as List, - isDefault: isDefault == freezed + isDefault: null == isDefault ? _value.isDefault : isDefault // ignore: cast_nullable_to_non_nullable as bool, - isFallback: isFallback == freezed + isFallback: null == isFallback ? _value.isFallback : isFallback // ignore: cast_nullable_to_non_nullable as bool, - hasJsonSerializable: hasJsonSerializable == freezed + hasJsonSerializable: null == hasJsonSerializable ? _value.hasJsonSerializable : hasJsonSerializable // ignore: cast_nullable_to_non_nullable as bool, - fullName: fullName == freezed + fullName: null == fullName ? _value.fullName : fullName // ignore: cast_nullable_to_non_nullable as String, - escapedName: escapedName == freezed + escapedName: null == escapedName ? _value.escapedName : escapedName // ignore: cast_nullable_to_non_nullable as String, - withDecorators: withDecorators == freezed - ? _value.withDecorators + withDecorators: null == withDecorators + ? _value._withDecorators : withDecorators // ignore: cast_nullable_to_non_nullable as List, - implementsDecorators: implementsDecorators == freezed - ? _value.implementsDecorators + implementsDecorators: null == implementsDecorators + ? _value._implementsDecorators : implementsDecorators // ignore: cast_nullable_to_non_nullable as List, - decorators: decorators == freezed - ? _value.decorators + decorators: null == decorators + ? _value._decorators : decorators // ignore: cast_nullable_to_non_nullable as List, - cloneableProperties: cloneableProperties == freezed - ? _value.cloneableProperties + cloneableProperties: null == cloneableProperties + ? _value._cloneableProperties : cloneableProperties // ignore: cast_nullable_to_non_nullable - as List, - asserts: asserts == freezed - ? _value.asserts + as List, + asserts: null == asserts + ? _value._asserts : asserts // ignore: cast_nullable_to_non_nullable as List, )); @@ -565,18 +505,24 @@ class _$_ConstructorDetails extends _ConstructorDetails { required this.isConst, required this.redirectedName, required this.parameters, - required this.impliedProperties, + required final List impliedProperties, required this.isDefault, required this.isFallback, required this.hasJsonSerializable, required this.fullName, required this.escapedName, - required this.withDecorators, - required this.implementsDecorators, - required this.decorators, - required this.cloneableProperties, - required this.asserts}) - : super._(); + required final List withDecorators, + required final List implementsDecorators, + required final List decorators, + required final List cloneableProperties, + required final List asserts}) + : _impliedProperties = impliedProperties, + _withDecorators = withDecorators, + _implementsDecorators = implementsDecorators, + _decorators = decorators, + _cloneableProperties = cloneableProperties, + _asserts = asserts, + super._(); @override final String name; @@ -588,8 +534,13 @@ class _$_ConstructorDetails extends _ConstructorDetails { final String redirectedName; @override final ParametersTemplate parameters; + final List _impliedProperties; @override - final List impliedProperties; + List get impliedProperties { + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_impliedProperties); + } + @override final bool isDefault; @override @@ -600,16 +551,40 @@ class _$_ConstructorDetails extends _ConstructorDetails { final String fullName; @override final String escapedName; + final List _withDecorators; @override - final List withDecorators; + List get withDecorators { + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_withDecorators); + } + + final List _implementsDecorators; @override - final List implementsDecorators; + List get implementsDecorators { + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_implementsDecorators); + } + + final List _decorators; @override - final List decorators; + List get decorators { + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_decorators); + } + + final List _cloneableProperties; @override - final List cloneableProperties; + List get cloneableProperties { + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_cloneableProperties); + } + + final List _asserts; @override - final List asserts; + List get asserts { + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_asserts); + } @override String toString() { @@ -620,7 +595,7 @@ class _$_ConstructorDetails extends _ConstructorDetails { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _ConstructorDetails && + other is _$_ConstructorDetails && (identical(other.name, name) || other.name == name) && (identical(other.unionValue, unionValue) || other.unionValue == unionValue) && @@ -630,7 +605,7 @@ class _$_ConstructorDetails extends _ConstructorDetails { (identical(other.parameters, parameters) || other.parameters == parameters) && const DeepCollectionEquality() - .equals(other.impliedProperties, impliedProperties) && + .equals(other._impliedProperties, _impliedProperties) && (identical(other.isDefault, isDefault) || other.isDefault == isDefault) && (identical(other.isFallback, isFallback) || @@ -642,14 +617,14 @@ class _$_ConstructorDetails extends _ConstructorDetails { (identical(other.escapedName, escapedName) || other.escapedName == escapedName) && const DeepCollectionEquality() - .equals(other.withDecorators, withDecorators) && + .equals(other._withDecorators, _withDecorators) && const DeepCollectionEquality() - .equals(other.implementsDecorators, implementsDecorators) && + .equals(other._implementsDecorators, _implementsDecorators) && const DeepCollectionEquality() - .equals(other.decorators, decorators) && + .equals(other._decorators, _decorators) && const DeepCollectionEquality() - .equals(other.cloneableProperties, cloneableProperties) && - const DeepCollectionEquality().equals(other.asserts, asserts)); + .equals(other._cloneableProperties, _cloneableProperties) && + const DeepCollectionEquality().equals(other._asserts, _asserts)); } @override @@ -660,42 +635,44 @@ class _$_ConstructorDetails extends _ConstructorDetails { isConst, redirectedName, parameters, - const DeepCollectionEquality().hash(impliedProperties), + const DeepCollectionEquality().hash(_impliedProperties), isDefault, isFallback, hasJsonSerializable, fullName, escapedName, - const DeepCollectionEquality().hash(withDecorators), - const DeepCollectionEquality().hash(implementsDecorators), - const DeepCollectionEquality().hash(decorators), - const DeepCollectionEquality().hash(cloneableProperties), - const DeepCollectionEquality().hash(asserts)); + const DeepCollectionEquality().hash(_withDecorators), + const DeepCollectionEquality().hash(_implementsDecorators), + const DeepCollectionEquality().hash(_decorators), + const DeepCollectionEquality().hash(_cloneableProperties), + const DeepCollectionEquality().hash(_asserts)); @JsonKey(ignore: true) @override - _$ConstructorDetailsCopyWith<_ConstructorDetails> get copyWith => - __$ConstructorDetailsCopyWithImpl<_ConstructorDetails>(this, _$identity); + @pragma('vm:prefer-inline') + _$$_ConstructorDetailsCopyWith<_$_ConstructorDetails> get copyWith => + __$$_ConstructorDetailsCopyWithImpl<_$_ConstructorDetails>( + this, _$identity); } abstract class _ConstructorDetails extends ConstructorDetails { factory _ConstructorDetails( - {required String name, - required String unionValue, - required bool isConst, - required String redirectedName, - required ParametersTemplate parameters, - required List impliedProperties, - required bool isDefault, - required bool isFallback, - required bool hasJsonSerializable, - required String fullName, - required String escapedName, - required List withDecorators, - required List implementsDecorators, - required List decorators, - required List cloneableProperties, - required List asserts}) = _$_ConstructorDetails; + {required final String name, + required final String unionValue, + required final bool isConst, + required final String redirectedName, + required final ParametersTemplate parameters, + required final List impliedProperties, + required final bool isDefault, + required final bool isFallback, + required final bool hasJsonSerializable, + required final String fullName, + required final String escapedName, + required final List withDecorators, + required final List implementsDecorators, + required final List decorators, + required final List cloneableProperties, + required final List asserts}) = _$_ConstructorDetails; _ConstructorDetails._() : super._(); @override @@ -727,32 +704,15 @@ abstract class _ConstructorDetails extends ConstructorDetails { @override List get decorators; @override - List get cloneableProperties; + List get cloneableProperties; @override List get asserts; @override @JsonKey(ignore: true) - _$ConstructorDetailsCopyWith<_ConstructorDetails> get copyWith => + _$$_ConstructorDetailsCopyWith<_$_ConstructorDetails> get copyWith => throw _privateConstructorUsedError; } -/// @nodoc -class _$MapConfigTearOff { - const _$MapConfigTearOff(); - - _MapConfig call( - {required bool map, required bool mapOrNull, required bool maybeMap}) { - return _MapConfig( - map: map, - mapOrNull: mapOrNull, - maybeMap: maybeMap, - ); - } -} - -/// @nodoc -const $MapConfig = _$MapConfigTearOff(); - /// @nodoc mixin _$MapConfig { bool get map => throw _privateConstructorUsedError; @@ -767,75 +727,80 @@ mixin _$MapConfig { /// @nodoc abstract class $MapConfigCopyWith<$Res> { factory $MapConfigCopyWith(MapConfig value, $Res Function(MapConfig) then) = - _$MapConfigCopyWithImpl<$Res>; + _$MapConfigCopyWithImpl<$Res, MapConfig>; + @useResult $Res call({bool map, bool mapOrNull, bool maybeMap}); } /// @nodoc -class _$MapConfigCopyWithImpl<$Res> implements $MapConfigCopyWith<$Res> { +class _$MapConfigCopyWithImpl<$Res, $Val extends MapConfig> + implements $MapConfigCopyWith<$Res> { _$MapConfigCopyWithImpl(this._value, this._then); - final MapConfig _value; // ignore: unused_field - final $Res Function(MapConfig) _then; + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + @pragma('vm:prefer-inline') @override $Res call({ - Object? map = freezed, - Object? mapOrNull = freezed, - Object? maybeMap = freezed, + Object? map = null, + Object? mapOrNull = null, + Object? maybeMap = null, }) { return _then(_value.copyWith( - map: map == freezed + map: null == map ? _value.map : map // ignore: cast_nullable_to_non_nullable as bool, - mapOrNull: mapOrNull == freezed + mapOrNull: null == mapOrNull ? _value.mapOrNull : mapOrNull // ignore: cast_nullable_to_non_nullable as bool, - maybeMap: maybeMap == freezed + maybeMap: null == maybeMap ? _value.maybeMap : maybeMap // ignore: cast_nullable_to_non_nullable as bool, - )); + ) as $Val); } } /// @nodoc -abstract class _$MapConfigCopyWith<$Res> implements $MapConfigCopyWith<$Res> { - factory _$MapConfigCopyWith( - _MapConfig value, $Res Function(_MapConfig) then) = - __$MapConfigCopyWithImpl<$Res>; +abstract class _$$_MapConfigCopyWith<$Res> implements $MapConfigCopyWith<$Res> { + factory _$$_MapConfigCopyWith( + _$_MapConfig value, $Res Function(_$_MapConfig) then) = + __$$_MapConfigCopyWithImpl<$Res>; @override + @useResult $Res call({bool map, bool mapOrNull, bool maybeMap}); } /// @nodoc -class __$MapConfigCopyWithImpl<$Res> extends _$MapConfigCopyWithImpl<$Res> - implements _$MapConfigCopyWith<$Res> { - __$MapConfigCopyWithImpl(_MapConfig _value, $Res Function(_MapConfig) _then) - : super(_value, (v) => _then(v as _MapConfig)); - - @override - _MapConfig get _value => super._value as _MapConfig; +class __$$_MapConfigCopyWithImpl<$Res> + extends _$MapConfigCopyWithImpl<$Res, _$_MapConfig> + implements _$$_MapConfigCopyWith<$Res> { + __$$_MapConfigCopyWithImpl( + _$_MapConfig _value, $Res Function(_$_MapConfig) _then) + : super(_value, _then); + @pragma('vm:prefer-inline') @override $Res call({ - Object? map = freezed, - Object? mapOrNull = freezed, - Object? maybeMap = freezed, + Object? map = null, + Object? mapOrNull = null, + Object? maybeMap = null, }) { - return _then(_MapConfig( - map: map == freezed + return _then(_$_MapConfig( + map: null == map ? _value.map : map // ignore: cast_nullable_to_non_nullable as bool, - mapOrNull: mapOrNull == freezed + mapOrNull: null == mapOrNull ? _value.mapOrNull : mapOrNull // ignore: cast_nullable_to_non_nullable as bool, - maybeMap: maybeMap == freezed + maybeMap: null == maybeMap ? _value.maybeMap : maybeMap // ignore: cast_nullable_to_non_nullable as bool, @@ -865,7 +830,7 @@ class _$_MapConfig implements _MapConfig { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _MapConfig && + other is _$_MapConfig && (identical(other.map, map) || other.map == map) && (identical(other.mapOrNull, mapOrNull) || other.mapOrNull == mapOrNull) && @@ -878,15 +843,16 @@ class _$_MapConfig implements _MapConfig { @JsonKey(ignore: true) @override - _$MapConfigCopyWith<_MapConfig> get copyWith => - __$MapConfigCopyWithImpl<_MapConfig>(this, _$identity); + @pragma('vm:prefer-inline') + _$$_MapConfigCopyWith<_$_MapConfig> get copyWith => + __$$_MapConfigCopyWithImpl<_$_MapConfig>(this, _$identity); } abstract class _MapConfig implements MapConfig { factory _MapConfig( - {required bool map, - required bool mapOrNull, - required bool maybeMap}) = _$_MapConfig; + {required final bool map, + required final bool mapOrNull, + required final bool maybeMap}) = _$_MapConfig; @override bool get map; @@ -896,27 +862,10 @@ abstract class _MapConfig implements MapConfig { bool get maybeMap; @override @JsonKey(ignore: true) - _$MapConfigCopyWith<_MapConfig> get copyWith => + _$$_MapConfigCopyWith<_$_MapConfig> get copyWith => throw _privateConstructorUsedError; } -/// @nodoc -class _$WhenConfigTearOff { - const _$WhenConfigTearOff(); - - _WhenConfig call( - {required bool when, required bool whenOrNull, required bool maybeWhen}) { - return _WhenConfig( - when: when, - whenOrNull: whenOrNull, - maybeWhen: maybeWhen, - ); - } -} - -/// @nodoc -const $WhenConfig = _$WhenConfigTearOff(); - /// @nodoc mixin _$WhenConfig { bool get when => throw _privateConstructorUsedError; @@ -932,76 +881,81 @@ mixin _$WhenConfig { abstract class $WhenConfigCopyWith<$Res> { factory $WhenConfigCopyWith( WhenConfig value, $Res Function(WhenConfig) then) = - _$WhenConfigCopyWithImpl<$Res>; + _$WhenConfigCopyWithImpl<$Res, WhenConfig>; + @useResult $Res call({bool when, bool whenOrNull, bool maybeWhen}); } /// @nodoc -class _$WhenConfigCopyWithImpl<$Res> implements $WhenConfigCopyWith<$Res> { +class _$WhenConfigCopyWithImpl<$Res, $Val extends WhenConfig> + implements $WhenConfigCopyWith<$Res> { _$WhenConfigCopyWithImpl(this._value, this._then); - final WhenConfig _value; // ignore: unused_field - final $Res Function(WhenConfig) _then; + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + @pragma('vm:prefer-inline') @override $Res call({ - Object? when = freezed, - Object? whenOrNull = freezed, - Object? maybeWhen = freezed, + Object? when = null, + Object? whenOrNull = null, + Object? maybeWhen = null, }) { return _then(_value.copyWith( - when: when == freezed + when: null == when ? _value.when : when // ignore: cast_nullable_to_non_nullable as bool, - whenOrNull: whenOrNull == freezed + whenOrNull: null == whenOrNull ? _value.whenOrNull : whenOrNull // ignore: cast_nullable_to_non_nullable as bool, - maybeWhen: maybeWhen == freezed + maybeWhen: null == maybeWhen ? _value.maybeWhen : maybeWhen // ignore: cast_nullable_to_non_nullable as bool, - )); + ) as $Val); } } /// @nodoc -abstract class _$WhenConfigCopyWith<$Res> implements $WhenConfigCopyWith<$Res> { - factory _$WhenConfigCopyWith( - _WhenConfig value, $Res Function(_WhenConfig) then) = - __$WhenConfigCopyWithImpl<$Res>; +abstract class _$$_WhenConfigCopyWith<$Res> + implements $WhenConfigCopyWith<$Res> { + factory _$$_WhenConfigCopyWith( + _$_WhenConfig value, $Res Function(_$_WhenConfig) then) = + __$$_WhenConfigCopyWithImpl<$Res>; @override + @useResult $Res call({bool when, bool whenOrNull, bool maybeWhen}); } /// @nodoc -class __$WhenConfigCopyWithImpl<$Res> extends _$WhenConfigCopyWithImpl<$Res> - implements _$WhenConfigCopyWith<$Res> { - __$WhenConfigCopyWithImpl( - _WhenConfig _value, $Res Function(_WhenConfig) _then) - : super(_value, (v) => _then(v as _WhenConfig)); - - @override - _WhenConfig get _value => super._value as _WhenConfig; +class __$$_WhenConfigCopyWithImpl<$Res> + extends _$WhenConfigCopyWithImpl<$Res, _$_WhenConfig> + implements _$$_WhenConfigCopyWith<$Res> { + __$$_WhenConfigCopyWithImpl( + _$_WhenConfig _value, $Res Function(_$_WhenConfig) _then) + : super(_value, _then); + @pragma('vm:prefer-inline') @override $Res call({ - Object? when = freezed, - Object? whenOrNull = freezed, - Object? maybeWhen = freezed, + Object? when = null, + Object? whenOrNull = null, + Object? maybeWhen = null, }) { - return _then(_WhenConfig( - when: when == freezed + return _then(_$_WhenConfig( + when: null == when ? _value.when : when // ignore: cast_nullable_to_non_nullable as bool, - whenOrNull: whenOrNull == freezed + whenOrNull: null == whenOrNull ? _value.whenOrNull : whenOrNull // ignore: cast_nullable_to_non_nullable as bool, - maybeWhen: maybeWhen == freezed + maybeWhen: null == maybeWhen ? _value.maybeWhen : maybeWhen // ignore: cast_nullable_to_non_nullable as bool, @@ -1031,7 +985,7 @@ class _$_WhenConfig implements _WhenConfig { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _WhenConfig && + other is _$_WhenConfig && (identical(other.when, when) || other.when == when) && (identical(other.whenOrNull, whenOrNull) || other.whenOrNull == whenOrNull) && @@ -1044,15 +998,16 @@ class _$_WhenConfig implements _WhenConfig { @JsonKey(ignore: true) @override - _$WhenConfigCopyWith<_WhenConfig> get copyWith => - __$WhenConfigCopyWithImpl<_WhenConfig>(this, _$identity); + @pragma('vm:prefer-inline') + _$$_WhenConfigCopyWith<_$_WhenConfig> get copyWith => + __$$_WhenConfigCopyWithImpl<_$_WhenConfig>(this, _$identity); } abstract class _WhenConfig implements WhenConfig { factory _WhenConfig( - {required bool when, - required bool whenOrNull, - required bool maybeWhen}) = _$_WhenConfig; + {required final bool when, + required final bool whenOrNull, + required final bool maybeWhen}) = _$_WhenConfig; @override bool get when; @@ -1062,55 +1017,10 @@ abstract class _WhenConfig implements WhenConfig { bool get maybeWhen; @override @JsonKey(ignore: true) - _$WhenConfigCopyWith<_WhenConfig> get copyWith => + _$$_WhenConfigCopyWith<_$_WhenConfig> get copyWith => throw _privateConstructorUsedError; } -/// @nodoc -class _$DataTearOff { - const _$DataTearOff(); - - _Data call( - {required String name, - required String unionKey, - required bool generateCopyWith, - required bool generateEqual, - required bool generateToString, - required MapConfig map, - required WhenConfig when, - required bool generateFromJson, - required bool generateToJson, - required bool makeCollectionsImmutable, - required List concretePropertiesName, - required List constructors, - required GenericsDefinitionTemplate genericsDefinitionTemplate, - required GenericsParameterTemplate genericsParameterTemplate, - required bool shouldUseExtends, - required bool genericArgumentFactories}) { - return _Data( - name: name, - unionKey: unionKey, - generateCopyWith: generateCopyWith, - generateEqual: generateEqual, - generateToString: generateToString, - map: map, - when: when, - generateFromJson: generateFromJson, - generateToJson: generateToJson, - makeCollectionsImmutable: makeCollectionsImmutable, - concretePropertiesName: concretePropertiesName, - constructors: constructors, - genericsDefinitionTemplate: genericsDefinitionTemplate, - genericsParameterTemplate: genericsParameterTemplate, - shouldUseExtends: shouldUseExtends, - genericArgumentFactories: genericArgumentFactories, - ); - } -} - -/// @nodoc -const $Data = _$DataTearOff(); - /// @nodoc mixin _$Data { String get name => throw _privateConstructorUsedError; @@ -1140,7 +1050,8 @@ mixin _$Data { /// @nodoc abstract class $DataCopyWith<$Res> { factory $DataCopyWith(Data value, $Res Function(Data) then) = - _$DataCopyWithImpl<$Res>; + _$DataCopyWithImpl<$Res, Data>; + @useResult $Res call( {String name, String unionKey, @@ -1164,120 +1075,126 @@ abstract class $DataCopyWith<$Res> { } /// @nodoc -class _$DataCopyWithImpl<$Res> implements $DataCopyWith<$Res> { +class _$DataCopyWithImpl<$Res, $Val extends Data> + implements $DataCopyWith<$Res> { _$DataCopyWithImpl(this._value, this._then); - final Data _value; // ignore: unused_field - final $Res Function(Data) _then; + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + @pragma('vm:prefer-inline') @override $Res call({ - Object? name = freezed, - Object? unionKey = freezed, - Object? generateCopyWith = freezed, - Object? generateEqual = freezed, - Object? generateToString = freezed, - Object? map = freezed, - Object? when = freezed, - Object? generateFromJson = freezed, - Object? generateToJson = freezed, - Object? makeCollectionsImmutable = freezed, - Object? concretePropertiesName = freezed, - Object? constructors = freezed, - Object? genericsDefinitionTemplate = freezed, - Object? genericsParameterTemplate = freezed, - Object? shouldUseExtends = freezed, - Object? genericArgumentFactories = freezed, + Object? name = null, + Object? unionKey = null, + Object? generateCopyWith = null, + Object? generateEqual = null, + Object? generateToString = null, + Object? map = null, + Object? when = null, + Object? generateFromJson = null, + Object? generateToJson = null, + Object? makeCollectionsImmutable = null, + Object? concretePropertiesName = null, + Object? constructors = null, + Object? genericsDefinitionTemplate = null, + Object? genericsParameterTemplate = null, + Object? shouldUseExtends = null, + Object? genericArgumentFactories = null, }) { return _then(_value.copyWith( - name: name == freezed + name: null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, - unionKey: unionKey == freezed + unionKey: null == unionKey ? _value.unionKey : unionKey // ignore: cast_nullable_to_non_nullable as String, - generateCopyWith: generateCopyWith == freezed + generateCopyWith: null == generateCopyWith ? _value.generateCopyWith : generateCopyWith // ignore: cast_nullable_to_non_nullable as bool, - generateEqual: generateEqual == freezed + generateEqual: null == generateEqual ? _value.generateEqual : generateEqual // ignore: cast_nullable_to_non_nullable as bool, - generateToString: generateToString == freezed + generateToString: null == generateToString ? _value.generateToString : generateToString // ignore: cast_nullable_to_non_nullable as bool, - map: map == freezed + map: null == map ? _value.map : map // ignore: cast_nullable_to_non_nullable as MapConfig, - when: when == freezed + when: null == when ? _value.when : when // ignore: cast_nullable_to_non_nullable as WhenConfig, - generateFromJson: generateFromJson == freezed + generateFromJson: null == generateFromJson ? _value.generateFromJson : generateFromJson // ignore: cast_nullable_to_non_nullable as bool, - generateToJson: generateToJson == freezed + generateToJson: null == generateToJson ? _value.generateToJson : generateToJson // ignore: cast_nullable_to_non_nullable as bool, - makeCollectionsImmutable: makeCollectionsImmutable == freezed + makeCollectionsImmutable: null == makeCollectionsImmutable ? _value.makeCollectionsImmutable : makeCollectionsImmutable // ignore: cast_nullable_to_non_nullable as bool, - concretePropertiesName: concretePropertiesName == freezed + concretePropertiesName: null == concretePropertiesName ? _value.concretePropertiesName : concretePropertiesName // ignore: cast_nullable_to_non_nullable as List, - constructors: constructors == freezed + constructors: null == constructors ? _value.constructors : constructors // ignore: cast_nullable_to_non_nullable as List, - genericsDefinitionTemplate: genericsDefinitionTemplate == freezed + genericsDefinitionTemplate: null == genericsDefinitionTemplate ? _value.genericsDefinitionTemplate : genericsDefinitionTemplate // ignore: cast_nullable_to_non_nullable as GenericsDefinitionTemplate, - genericsParameterTemplate: genericsParameterTemplate == freezed + genericsParameterTemplate: null == genericsParameterTemplate ? _value.genericsParameterTemplate : genericsParameterTemplate // ignore: cast_nullable_to_non_nullable as GenericsParameterTemplate, - shouldUseExtends: shouldUseExtends == freezed + shouldUseExtends: null == shouldUseExtends ? _value.shouldUseExtends : shouldUseExtends // ignore: cast_nullable_to_non_nullable as bool, - genericArgumentFactories: genericArgumentFactories == freezed + genericArgumentFactories: null == genericArgumentFactories ? _value.genericArgumentFactories : genericArgumentFactories // ignore: cast_nullable_to_non_nullable as bool, - )); + ) as $Val); } @override + @pragma('vm:prefer-inline') $MapConfigCopyWith<$Res> get map { return $MapConfigCopyWith<$Res>(_value.map, (value) { - return _then(_value.copyWith(map: value)); + return _then(_value.copyWith(map: value) as $Val); }); } @override + @pragma('vm:prefer-inline') $WhenConfigCopyWith<$Res> get when { return $WhenConfigCopyWith<$Res>(_value.when, (value) { - return _then(_value.copyWith(when: value)); + return _then(_value.copyWith(when: value) as $Val); }); } } /// @nodoc -abstract class _$DataCopyWith<$Res> implements $DataCopyWith<$Res> { - factory _$DataCopyWith(_Data value, $Res Function(_Data) then) = - __$DataCopyWithImpl<$Res>; +abstract class _$$_DataCopyWith<$Res> implements $DataCopyWith<$Res> { + factory _$$_DataCopyWith(_$_Data value, $Res Function(_$_Data) then) = + __$$_DataCopyWithImpl<$Res>; @override + @useResult $Res call( {String name, String unionKey, @@ -1303,95 +1220,93 @@ abstract class _$DataCopyWith<$Res> implements $DataCopyWith<$Res> { } /// @nodoc -class __$DataCopyWithImpl<$Res> extends _$DataCopyWithImpl<$Res> - implements _$DataCopyWith<$Res> { - __$DataCopyWithImpl(_Data _value, $Res Function(_Data) _then) - : super(_value, (v) => _then(v as _Data)); - - @override - _Data get _value => super._value as _Data; +class __$$_DataCopyWithImpl<$Res> extends _$DataCopyWithImpl<$Res, _$_Data> + implements _$$_DataCopyWith<$Res> { + __$$_DataCopyWithImpl(_$_Data _value, $Res Function(_$_Data) _then) + : super(_value, _then); + @pragma('vm:prefer-inline') @override $Res call({ - Object? name = freezed, - Object? unionKey = freezed, - Object? generateCopyWith = freezed, - Object? generateEqual = freezed, - Object? generateToString = freezed, - Object? map = freezed, - Object? when = freezed, - Object? generateFromJson = freezed, - Object? generateToJson = freezed, - Object? makeCollectionsImmutable = freezed, - Object? concretePropertiesName = freezed, - Object? constructors = freezed, - Object? genericsDefinitionTemplate = freezed, - Object? genericsParameterTemplate = freezed, - Object? shouldUseExtends = freezed, - Object? genericArgumentFactories = freezed, + Object? name = null, + Object? unionKey = null, + Object? generateCopyWith = null, + Object? generateEqual = null, + Object? generateToString = null, + Object? map = null, + Object? when = null, + Object? generateFromJson = null, + Object? generateToJson = null, + Object? makeCollectionsImmutable = null, + Object? concretePropertiesName = null, + Object? constructors = null, + Object? genericsDefinitionTemplate = null, + Object? genericsParameterTemplate = null, + Object? shouldUseExtends = null, + Object? genericArgumentFactories = null, }) { - return _then(_Data( - name: name == freezed + return _then(_$_Data( + name: null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, - unionKey: unionKey == freezed + unionKey: null == unionKey ? _value.unionKey : unionKey // ignore: cast_nullable_to_non_nullable as String, - generateCopyWith: generateCopyWith == freezed + generateCopyWith: null == generateCopyWith ? _value.generateCopyWith : generateCopyWith // ignore: cast_nullable_to_non_nullable as bool, - generateEqual: generateEqual == freezed + generateEqual: null == generateEqual ? _value.generateEqual : generateEqual // ignore: cast_nullable_to_non_nullable as bool, - generateToString: generateToString == freezed + generateToString: null == generateToString ? _value.generateToString : generateToString // ignore: cast_nullable_to_non_nullable as bool, - map: map == freezed + map: null == map ? _value.map : map // ignore: cast_nullable_to_non_nullable as MapConfig, - when: when == freezed + when: null == when ? _value.when : when // ignore: cast_nullable_to_non_nullable as WhenConfig, - generateFromJson: generateFromJson == freezed + generateFromJson: null == generateFromJson ? _value.generateFromJson : generateFromJson // ignore: cast_nullable_to_non_nullable as bool, - generateToJson: generateToJson == freezed + generateToJson: null == generateToJson ? _value.generateToJson : generateToJson // ignore: cast_nullable_to_non_nullable as bool, - makeCollectionsImmutable: makeCollectionsImmutable == freezed + makeCollectionsImmutable: null == makeCollectionsImmutable ? _value.makeCollectionsImmutable : makeCollectionsImmutable // ignore: cast_nullable_to_non_nullable as bool, - concretePropertiesName: concretePropertiesName == freezed - ? _value.concretePropertiesName + concretePropertiesName: null == concretePropertiesName + ? _value._concretePropertiesName : concretePropertiesName // ignore: cast_nullable_to_non_nullable as List, - constructors: constructors == freezed - ? _value.constructors + constructors: null == constructors + ? _value._constructors : constructors // ignore: cast_nullable_to_non_nullable as List, - genericsDefinitionTemplate: genericsDefinitionTemplate == freezed + genericsDefinitionTemplate: null == genericsDefinitionTemplate ? _value.genericsDefinitionTemplate : genericsDefinitionTemplate // ignore: cast_nullable_to_non_nullable as GenericsDefinitionTemplate, - genericsParameterTemplate: genericsParameterTemplate == freezed + genericsParameterTemplate: null == genericsParameterTemplate ? _value.genericsParameterTemplate : genericsParameterTemplate // ignore: cast_nullable_to_non_nullable as GenericsParameterTemplate, - shouldUseExtends: shouldUseExtends == freezed + shouldUseExtends: null == shouldUseExtends ? _value.shouldUseExtends : shouldUseExtends // ignore: cast_nullable_to_non_nullable as bool, - genericArgumentFactories: genericArgumentFactories == freezed + genericArgumentFactories: null == genericArgumentFactories ? _value.genericArgumentFactories : genericArgumentFactories // ignore: cast_nullable_to_non_nullable as bool, @@ -1413,13 +1328,15 @@ class _$_Data implements _Data { required this.generateFromJson, required this.generateToJson, required this.makeCollectionsImmutable, - required this.concretePropertiesName, - required this.constructors, + required final List concretePropertiesName, + required final List constructors, required this.genericsDefinitionTemplate, required this.genericsParameterTemplate, required this.shouldUseExtends, required this.genericArgumentFactories}) - : assert(constructors.isNotEmpty); + : assert(constructors.isNotEmpty), + _concretePropertiesName = concretePropertiesName, + _constructors = constructors; @override final String name; @@ -1441,10 +1358,20 @@ class _$_Data implements _Data { final bool generateToJson; @override final bool makeCollectionsImmutable; + final List _concretePropertiesName; @override - final List concretePropertiesName; + List get concretePropertiesName { + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_concretePropertiesName); + } + + final List _constructors; @override - final List constructors; + List get constructors { + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_constructors); + } + @override final GenericsDefinitionTemplate genericsDefinitionTemplate; @override @@ -1463,7 +1390,7 @@ class _$_Data implements _Data { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _Data && + other is _$_Data && (identical(other.name, name) || other.name == name) && (identical(other.unionKey, unionKey) || other.unionKey == unionKey) && @@ -1482,10 +1409,10 @@ class _$_Data implements _Data { (identical( other.makeCollectionsImmutable, makeCollectionsImmutable) || other.makeCollectionsImmutable == makeCollectionsImmutable) && + const DeepCollectionEquality().equals( + other._concretePropertiesName, _concretePropertiesName) && const DeepCollectionEquality() - .equals(other.concretePropertiesName, concretePropertiesName) && - const DeepCollectionEquality() - .equals(other.constructors, constructors) && + .equals(other._constructors, _constructors) && (identical(other.genericsDefinitionTemplate, genericsDefinitionTemplate) || other.genericsDefinitionTemplate == @@ -1513,8 +1440,8 @@ class _$_Data implements _Data { generateFromJson, generateToJson, makeCollectionsImmutable, - const DeepCollectionEquality().hash(concretePropertiesName), - const DeepCollectionEquality().hash(constructors), + const DeepCollectionEquality().hash(_concretePropertiesName), + const DeepCollectionEquality().hash(_constructors), genericsDefinitionTemplate, genericsParameterTemplate, shouldUseExtends, @@ -1522,28 +1449,29 @@ class _$_Data implements _Data { @JsonKey(ignore: true) @override - _$DataCopyWith<_Data> get copyWith => - __$DataCopyWithImpl<_Data>(this, _$identity); + @pragma('vm:prefer-inline') + _$$_DataCopyWith<_$_Data> get copyWith => + __$$_DataCopyWithImpl<_$_Data>(this, _$identity); } abstract class _Data implements Data { factory _Data( - {required String name, - required String unionKey, - required bool generateCopyWith, - required bool generateEqual, - required bool generateToString, - required MapConfig map, - required WhenConfig when, - required bool generateFromJson, - required bool generateToJson, - required bool makeCollectionsImmutable, - required List concretePropertiesName, - required List constructors, - required GenericsDefinitionTemplate genericsDefinitionTemplate, - required GenericsParameterTemplate genericsParameterTemplate, - required bool shouldUseExtends, - required bool genericArgumentFactories}) = _$_Data; + {required final String name, + required final String unionKey, + required final bool generateCopyWith, + required final bool generateEqual, + required final bool generateToString, + required final MapConfig map, + required final WhenConfig when, + required final bool generateFromJson, + required final bool generateToJson, + required final bool makeCollectionsImmutable, + required final List concretePropertiesName, + required final List constructors, + required final GenericsDefinitionTemplate genericsDefinitionTemplate, + required final GenericsParameterTemplate genericsParameterTemplate, + required final bool shouldUseExtends, + required final bool genericArgumentFactories}) = _$_Data; @override String get name; @@ -1579,24 +1507,9 @@ abstract class _Data implements Data { bool get genericArgumentFactories; @override @JsonKey(ignore: true) - _$DataCopyWith<_Data> get copyWith => throw _privateConstructorUsedError; + _$$_DataCopyWith<_$_Data> get copyWith => throw _privateConstructorUsedError; } -/// @nodoc -class _$GlobalDataTearOff { - const _$GlobalDataTearOff(); - - _GlobalData call({required bool hasJson, required bool hasDiagnostics}) { - return _GlobalData( - hasJson: hasJson, - hasDiagnostics: hasDiagnostics, - ); - } -} - -/// @nodoc -const $GlobalData = _$GlobalDataTearOff(); - /// @nodoc mixin _$GlobalData { bool get hasJson => throw _privateConstructorUsedError; @@ -1611,66 +1524,71 @@ mixin _$GlobalData { abstract class $GlobalDataCopyWith<$Res> { factory $GlobalDataCopyWith( GlobalData value, $Res Function(GlobalData) then) = - _$GlobalDataCopyWithImpl<$Res>; + _$GlobalDataCopyWithImpl<$Res, GlobalData>; + @useResult $Res call({bool hasJson, bool hasDiagnostics}); } /// @nodoc -class _$GlobalDataCopyWithImpl<$Res> implements $GlobalDataCopyWith<$Res> { +class _$GlobalDataCopyWithImpl<$Res, $Val extends GlobalData> + implements $GlobalDataCopyWith<$Res> { _$GlobalDataCopyWithImpl(this._value, this._then); - final GlobalData _value; // ignore: unused_field - final $Res Function(GlobalData) _then; + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + @pragma('vm:prefer-inline') @override $Res call({ - Object? hasJson = freezed, - Object? hasDiagnostics = freezed, + Object? hasJson = null, + Object? hasDiagnostics = null, }) { return _then(_value.copyWith( - hasJson: hasJson == freezed + hasJson: null == hasJson ? _value.hasJson : hasJson // ignore: cast_nullable_to_non_nullable as bool, - hasDiagnostics: hasDiagnostics == freezed + hasDiagnostics: null == hasDiagnostics ? _value.hasDiagnostics : hasDiagnostics // ignore: cast_nullable_to_non_nullable as bool, - )); + ) as $Val); } } /// @nodoc -abstract class _$GlobalDataCopyWith<$Res> implements $GlobalDataCopyWith<$Res> { - factory _$GlobalDataCopyWith( - _GlobalData value, $Res Function(_GlobalData) then) = - __$GlobalDataCopyWithImpl<$Res>; +abstract class _$$_GlobalDataCopyWith<$Res> + implements $GlobalDataCopyWith<$Res> { + factory _$$_GlobalDataCopyWith( + _$_GlobalData value, $Res Function(_$_GlobalData) then) = + __$$_GlobalDataCopyWithImpl<$Res>; @override + @useResult $Res call({bool hasJson, bool hasDiagnostics}); } /// @nodoc -class __$GlobalDataCopyWithImpl<$Res> extends _$GlobalDataCopyWithImpl<$Res> - implements _$GlobalDataCopyWith<$Res> { - __$GlobalDataCopyWithImpl( - _GlobalData _value, $Res Function(_GlobalData) _then) - : super(_value, (v) => _then(v as _GlobalData)); - - @override - _GlobalData get _value => super._value as _GlobalData; +class __$$_GlobalDataCopyWithImpl<$Res> + extends _$GlobalDataCopyWithImpl<$Res, _$_GlobalData> + implements _$$_GlobalDataCopyWith<$Res> { + __$$_GlobalDataCopyWithImpl( + _$_GlobalData _value, $Res Function(_$_GlobalData) _then) + : super(_value, _then); + @pragma('vm:prefer-inline') @override $Res call({ - Object? hasJson = freezed, - Object? hasDiagnostics = freezed, + Object? hasJson = null, + Object? hasDiagnostics = null, }) { - return _then(_GlobalData( - hasJson: hasJson == freezed + return _then(_$_GlobalData( + hasJson: null == hasJson ? _value.hasJson : hasJson // ignore: cast_nullable_to_non_nullable as bool, - hasDiagnostics: hasDiagnostics == freezed + hasDiagnostics: null == hasDiagnostics ? _value.hasDiagnostics : hasDiagnostics // ignore: cast_nullable_to_non_nullable as bool, @@ -1697,7 +1615,7 @@ class _$_GlobalData implements _GlobalData { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _GlobalData && + other is _$_GlobalData && (identical(other.hasJson, hasJson) || other.hasJson == hasJson) && (identical(other.hasDiagnostics, hasDiagnostics) || other.hasDiagnostics == hasDiagnostics)); @@ -1708,13 +1626,15 @@ class _$_GlobalData implements _GlobalData { @JsonKey(ignore: true) @override - _$GlobalDataCopyWith<_GlobalData> get copyWith => - __$GlobalDataCopyWithImpl<_GlobalData>(this, _$identity); + @pragma('vm:prefer-inline') + _$$_GlobalDataCopyWith<_$_GlobalData> get copyWith => + __$$_GlobalDataCopyWithImpl<_$_GlobalData>(this, _$identity); } abstract class _GlobalData implements GlobalData { - factory _GlobalData({required bool hasJson, required bool hasDiagnostics}) = - _$_GlobalData; + factory _GlobalData( + {required final bool hasJson, + required final bool hasDiagnostics}) = _$_GlobalData; @override bool get hasJson; @@ -1722,6 +1642,6 @@ abstract class _GlobalData implements GlobalData { bool get hasDiagnostics; @override @JsonKey(ignore: true) - _$GlobalDataCopyWith<_GlobalData> get copyWith => + _$$_GlobalDataCopyWith<_$_GlobalData> get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/_internal/pubspec.lock b/packages/_internal/pubspec.lock index 62f2e204..2ea6296a 100644 --- a/packages/_internal/pubspec.lock +++ b/packages/_internal/pubspec.lock @@ -5,386 +5,425 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + sha256: "3444216bfd127af50bbe4862d8843ed44db946dd933554f0d7285e89f10e28ac" + url: "https://pub.dev" source: hosted - version: "30.0.0" + version: "50.0.0" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.dartlang.org" + sha256: "68796c31f510c8455a06fed75fc97d8e5ad04d324a830322ab3efc9feb6201c1" + url: "https://pub.dev" source: hosted - version: "2.7.0" + version: "5.2.0" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + sha256: b003c3098049a51720352d219b0bb5f219b60fbfb68e7a4748139a06a5676515 + url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.3.1" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + url: "https://pub.dev" source: hosted - version: "2.8.2" + version: "2.10.0" build: dependency: transitive description: name: build - url: "https://pub.dartlang.org" + sha256: "3fbda25365741f8251b39f3917fb3c8e286a96fd068a5a242e11c2012d495777" + url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.3.1" build_config: dependency: transitive description: name: build_config - url: "https://pub.dartlang.org" + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.1.1" build_daemon: dependency: transitive description: name: build_daemon - url: "https://pub.dartlang.org" + sha256: "6bc5544ea6ce4428266e7ea680e945c68806c4aae2da0eb5e9ccf38df8d6acbf" + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.1.0" build_resolvers: dependency: transitive description: name: build_resolvers - url: "https://pub.dartlang.org" + sha256: "7c35a3a7868626257d8aee47b51c26b9dba11eaddf3431117ed2744951416aab" + url: "https://pub.dev" source: hosted - version: "2.0.4" + version: "2.1.0" build_runner: dependency: "direct dev" description: name: build_runner - url: "https://pub.dartlang.org" + sha256: "6f48c61a9dcd2c3a9e62d3dcdab1ba382790e2f31026288cbabe55d6003c9c23" + url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.3.2" build_runner_core: dependency: transitive description: name: build_runner_core - url: "https://pub.dartlang.org" + sha256: "14febe0f5bac5ae474117a36099b4de6f1dbc52df6c5e55534b3da9591bf4292" + url: "https://pub.dev" source: hosted - version: "7.2.2" + version: "7.2.7" built_collection: dependency: transitive description: name: built_collection - url: "https://pub.dartlang.org" + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" source: hosted version: "5.1.1" built_value: dependency: transitive description: name: built_value - url: "https://pub.dartlang.org" - source: hosted - version: "8.1.3" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" + sha256: "59e08b0079bb75f7e27392498e26339387c1089c6bd58525a14eb8508637277b" + url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "8.4.2" checked_yaml: dependency: transitive description: name: checked_yaml - url: "https://pub.dartlang.org" + sha256: dd007e4fb8270916820a0d66e24f619266b60773cddd082c6439341645af2659 + url: "https://pub.dev" source: hosted version: "2.0.1" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.5" code_builder: dependency: transitive description: name: code_builder - url: "https://pub.dartlang.org" + sha256: "02ce3596b459c666530f045ad6f96209474e8fee6e4855940a3cee65fb872ec5" + url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "4.3.0" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.17.0" convert: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.1.1" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" dart_style: dependency: transitive description: name: dart_style - url: "https://pub.dartlang.org" + sha256: "7a03456c3490394c8e7665890333e91ae8a49be43542b616e414449ac358acd4" + url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.2.4" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" source: hosted - version: "6.1.2" + version: "6.1.4" fixnum: dependency: transitive description: name: fixnum - url: "https://pub.dartlang.org" + sha256: "04be3e934c52e082558cc9ee21f42f5c1cd7a1262f4c63cd0357c08d5bba81ec" + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.1" freezed: dependency: "direct dev" description: name: freezed - url: "https://pub.dartlang.org" + sha256: "7070a65156b1d60b81649005843b9a6ec861db6903dec2db082c95473c8f5f72" + url: "https://pub.dev" source: hosted - version: "0.15.1+1" + version: "2.2.1" freezed_annotation: dependency: "direct main" description: name: freezed_annotation - url: "https://pub.dartlang.org" + sha256: aeac15850ef1b38ee368d4c53ba9a847e900bb2c53a4db3f6881cbb3cb684338 + url: "https://pub.dev" source: hosted - version: "0.15.0" + version: "2.2.0" frontend_server_client: dependency: transitive description: name: frontend_server_client - url: "https://pub.dartlang.org" + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "3.2.0" glob: dependency: transitive description: name: glob - url: "https://pub.dartlang.org" + sha256: "4515b5b6ddb505ebdd242a5f2cc5d22d3d6a80013789debfbda7777f47ea308c" + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.1.1" graphs: dependency: transitive description: name: graphs - url: "https://pub.dartlang.org" + sha256: f9e130f3259f52d26f0cfc0e964513796dafed572fa52e45d2f8d6ca14db39b2 + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.2.0" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.dartlang.org" + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.2.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.0.2" io: dependency: transitive description: name: io - url: "https://pub.dartlang.org" + sha256: "0d4c73c3653ab85bf696d51a9657604c900a370549196a91f33e4c39af760852" + url: "https://pub.dev" source: hosted version: "1.0.3" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + url: "https://pub.dev" source: hosted - version: "0.6.3" + version: "0.6.5" json_annotation: dependency: transitive description: name: json_annotation - url: "https://pub.dartlang.org" + sha256: "3520fa844009431b5d4491a5a778603520cdc399ab3406332dcc50f93547258c" + url: "https://pub.dev" source: hosted - version: "4.3.0" + version: "4.7.0" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + sha256: c0bbfe94d46aedf9b8b3e695cf3bd48c8e14b35e3b2c639e0aa7755d589ba946 + url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.1.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + url: "https://pub.dev" source: hosted - version: "0.12.11" + version: "0.12.13" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.8.0" mime: dependency: transitive description: name: mime - url: "https://pub.dartlang.org" + sha256: "52e38f7e1143ef39daf532117d6b8f8f617bf4bcd6044ed8c29040d20d269630" + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.3" package_config: dependency: transitive description: name: package_config - url: "https://pub.dartlang.org" + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.1.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.8.2" pool: dependency: transitive description: name: pool - url: "https://pub.dartlang.org" + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" source: hosted - version: "1.5.0" + version: "1.5.1" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.dartlang.org" + sha256: "307de764d305289ff24ad257ad5c5793ce56d04947599ad68b3baa124105fc17" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.3" pubspec_parse: dependency: transitive description: name: pubspec_parse - url: "https://pub.dartlang.org" + sha256: "75f6614d6dde2dc68948dffbaa4fe5dae32cd700eb9fb763fe11dfb45a3c4d0a" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.1" shelf: dependency: transitive description: name: shelf - url: "https://pub.dartlang.org" + sha256: c24a96135a2ccd62c64b69315a14adc5c3419df63b4d7c05832a346fdb73682c + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.4.0" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.dartlang.org" + sha256: a988c0e8d8ffbdb8a28aa7ec8e449c260f3deb808781fe1284d22c5bba7156e8 + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.3" source_gen: dependency: transitive description: name: source_gen - url: "https://pub.dartlang.org" + sha256: "2d79738b6bbf38a43920e2b8d189e9a3ce6cc201f4b8fc76be5e4fe377b1c38d" + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.6" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.dartlang.org" + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" timing: dependency: transitive description: name: timing - url: "https://pub.dartlang.org" + sha256: c386d07d7f5efc613479a7c4d9d64b03710b03cfaa7e8ad5f2bfb295a1f0dfad + url: "https://pub.dev" source: hosted version: "1.0.0" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" + url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.3.1" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + sha256: "6a7f46926b01ce81bfc339da6a7f20afbe7733eff9846f6d6a5466aa4c6667c0" + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.2" web_socket_channel: dependency: transitive description: name: web_socket_channel - url: "https://pub.dartlang.org" + sha256: "3a969ddcc204a3e34e863d204b29c0752716f78b6f9cc8235083208d268a4ccd" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.2.0" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" + url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.1" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.18.0 <4.0.0" diff --git a/packages/_internal/pubspec.yaml b/packages/_internal/pubspec.yaml index 0116dda3..a28de47c 100644 --- a/packages/_internal/pubspec.yaml +++ b/packages/_internal/pubspec.yaml @@ -5,8 +5,8 @@ environment: sdk: ">=2.14.0 <3.0.0" dependencies: - freezed_annotation: ">=0.14.0" + freezed_annotation: ^2.0.0 dev_dependencies: build_runner: - freezed: ^0.15.0+1 + freezed: ^2.0.0 diff --git a/packages/freezed/lib/src/freezed_generator.dart b/packages/freezed/lib/src/freezed_generator.dart index fd5a6f52..e3ece343 100644 --- a/packages/freezed/lib/src/freezed_generator.dart +++ b/packages/freezed/lib/src/freezed_generator.dart @@ -43,6 +43,14 @@ extension on DartObject { } } +class CommonProperties { + /// Properties that have a getter in the abstract class + final List readableProperties = []; + + /// Properties that are visible on `copyWith` + final List cloneableProperties = []; +} + @immutable class FreezedGenerator extends ParserGenerator { FreezedGenerator(this._buildYamlConfigs); @@ -125,32 +133,6 @@ class FreezedGenerator extends ParserGenerator { ); } - List _commonProperties( - List constructorsNeedsGeneration, - ) { - final commonParameters = - _commonParametersBetweenAllConstructors(constructorsNeedsGeneration); - - return [ - for (final commonParameter in commonParameters) - Property( - decorators: commonParameter.decorators, - name: commonParameter.name, - isFinal: commonParameter.isFinal, - doc: commonParameter.doc, - type: commonParameter.type, - defaultValueSource: commonParameter.defaultValueSource, - isNullable: commonParameter.isNullable, - isDartList: commonParameter.isDartList, - isDartMap: commonParameter.isDartMap, - isDartSet: commonParameter.isDartSet, - isPossiblyDartCollection: commonParameter.isPossiblyDartCollection, - // TODO: support hasJsonKey - hasJsonKey: false, - ), - ]; - } - void _assertValidClassUsage(ClassElement element) { // TODO: verify _$name is mixed-in if (element.isAbstract) { @@ -247,30 +229,77 @@ Read here: https://github.com/rrousselGit/freezed/blob/master/packages/freezed/C return false; } - List _commonParametersBetweenAllConstructors( + CommonProperties _commonParametersBetweenAllConstructors( List constructorsNeedsGeneration, ) { - return constructorsNeedsGeneration.first.parameters.allParameters - .map((parameter) { - var hasAnyFinalProperty = false; - for (final constructor in constructorsNeedsGeneration) { - final matchingParameter = - constructor.parameters.allParameters.firstWhereOrNull((p) { - return p.name == parameter.name && p.type == parameter.type; - }); - - if (matchingParameter == null) return null; - if (matchingParameter.isFinal) hasAnyFinalProperty = true; - } - - if (hasAnyFinalProperty) { - return parameter.copyWith(isFinal: true); - } - - return parameter; - }) - .whereNotNull() - .toList(); + final result = CommonProperties(); + if (constructorsNeedsGeneration.length == 1) { + result.readableProperties.addAll( + constructorsNeedsGeneration.first.parameters.allParameters + .map(Property.fromParameter), + ); + result.cloneableProperties.addAll(result.readableProperties); + return result; + } + + parameterLoop: + for (final parameter + in constructorsNeedsGeneration.first.parameters.allParameters) { + final library = parameter.parameterElement!.library!; + + var anyMatchingPropertyIsFinal = parameter.isFinal; + var commonTypeBetweenAllUnionConstructors = + parameter.parameterElement!.type; + + // skip(1) as "parameter" is from the first constructor. + for (final constructor in constructorsNeedsGeneration) { + final matchingParameter = constructor.parameters.allParameters + .firstWhereOrNull((p) => p.name == parameter.name); + // The property is not present in one of the union cases, so shouldn't + // be present in the abstract class. + if (matchingParameter == null) continue parameterLoop; + + anyMatchingPropertyIsFinal = + anyMatchingPropertyIsFinal || matchingParameter.isFinal; + + commonTypeBetweenAllUnionConstructors = + library.typeSystem.leastUpperBound( + commonTypeBetweenAllUnionConstructors, + matchingParameter.parameterElement!.type, + ); + } + + final commonTypeString = resolveFullTypeStringFrom( + library, + commonTypeBetweenAllUnionConstructors, + withNullability: true, + ); + + final commonProperty = Property.fromParameter(parameter).copyWith( + isFinal: anyMatchingPropertyIsFinal || + // The field was downcasted because some union cases use a + // different type for that field. As such, there is no valid setter + parameter.type != commonTypeString, + type: commonTypeString, + ); + + result.readableProperties.add(commonProperty); + + // For {int a, int b, int c} | {int a, int? b, double c}, allows: + // copyWith({int a, int b}) + // - int? b is not allowed because `null` is not compatible with the + // first union case. + // - num c is not allowed because num is not assignable int/double + if (parameter.type == commonProperty.type || + '${parameter.type}?' == commonProperty.type) { + result.cloneableProperties.add( + // Let's not downcast copyWith parameters + commonProperty.copyWith(type: parameter.type), + ); + } + } + + return result; } Future> _parseConstructorsNeedsGeneration( @@ -311,7 +340,7 @@ Read here: https://github.com/rrousselGit/freezed/blob/master/packages/freezed/C escapedName: _escapedName(element, constructor), impliedProperties: [ for (final parameter in constructor.parameters) - await Property.fromParameter( + await Property.fromParameterElement( parameter, buildStep, addImplicitFinal: options.addImplicitFinal, @@ -337,7 +366,7 @@ Read here: https://github.com/rrousselGit/freezed/blob/master/packages/freezed/C isDefault: isDefaultConstructor(constructor), hasJsonSerializable: constructor.hasJsonSerializable, isFallback: constructor.isFallbackUnion(options.fallbackUnion), - cloneableProperties: await _cloneableProperties( + cloneableProperties: _cloneableProperties( buildStep, element, constructor, @@ -414,11 +443,11 @@ Read here: https://github.com/rrousselGit/freezed/blob/master/packages/freezed/C } } - Stream _cloneableProperties( + Iterable _cloneableProperties( BuildStep buildStep, ClassElement element, ConstructorElement constructor, - ) async* { + ) sync* { for (final parameter in constructor.parameters) { final type = parseTypeSource(parameter); @@ -436,7 +465,7 @@ Read here: https://github.com/rrousselGit/freezed/blob/master/packages/freezed/C // copyWith not enabled, so the property is not cloneable if (configs.copyWith != true) continue; - yield CloneableProperty( + yield DeepCloneableProperty( name: parameter.name, type: type!, nullable: @@ -452,7 +481,7 @@ Read here: https://github.com/rrousselGit/freezed/blob/master/packages/freezed/C } } - Iterable _commonCloneableProperties( + Iterable _getCommonDeepCloneableProperties( List constructors, List commonProperties, ) sync* { @@ -609,42 +638,45 @@ Read here: https://github.com/rrousselGit/freezed/blob/master/packages/freezed/C ); } - final commonProperties = _commonProperties(data.constructors); + final commonProperties = + _commonParametersBetweenAllConstructors(data.constructors); final commonCopyWith = !data.generateCopyWith ? null : CopyWith( clonedClassName: data.name, - cloneableProperties: _commonCloneableProperties( + readableProperties: commonProperties.readableProperties, + cloneableProperties: commonProperties.cloneableProperties, + deepCloneableProperties: _getCommonDeepCloneableProperties( data.constructors, - commonProperties, + commonProperties.cloneableProperties, ).toList(), genericsDefinition: data.genericsDefinitionTemplate, genericsParameter: data.genericsParameterTemplate, - allProperties: commonProperties, data: data, ); yield Abstract( data: data, copyWith: commonCopyWith, - commonProperties: commonProperties, + commonProperties: commonProperties.readableProperties, ); for (final constructor in data.constructors) { yield Concrete( data: data, constructor: constructor, - commonProperties: commonProperties, + commonProperties: commonProperties.readableProperties, globalData: globalData, copyWith: !data.generateCopyWith ? null : CopyWith( clonedClassName: '_\$${constructor.redirectedName}', - cloneableProperties: constructor.cloneableProperties, + cloneableProperties: constructor.impliedProperties, + readableProperties: constructor.impliedProperties, + deepCloneableProperties: constructor.cloneableProperties, genericsDefinition: data.genericsDefinitionTemplate, genericsParameter: data.genericsParameterTemplate, - allProperties: constructor.impliedProperties, data: data, parent: commonCopyWith, ), diff --git a/packages/freezed/lib/src/models.dart b/packages/freezed/lib/src/models.dart index 0f2e42e4..26a8ea58 100644 --- a/packages/freezed/lib/src/models.dart +++ b/packages/freezed/lib/src/models.dart @@ -15,14 +15,14 @@ part 'models.freezed.dart'; /// This allows Freezed to support deep copy of the object. /// This does include primitives like [int] and [List]. @freezed -class CloneableProperty with _$CloneableProperty { - factory CloneableProperty({ +class DeepCloneableProperty with _$DeepCloneableProperty { + factory DeepCloneableProperty({ required String name, required String typeName, required String type, required bool nullable, required GenericsParameterTemplate genericParameters, - }) = _CloneableProperty; + }) = _DeepCloneableProperty; } /// The information of a specific constructor of a class tagged with `@freezed`. @@ -45,7 +45,7 @@ class ConstructorDetails with _$ConstructorDetails { required List withDecorators, required List implementsDecorators, required List decorators, - required List cloneableProperties, + required List cloneableProperties, required List asserts, }) = _ConstructorDetails; diff --git a/packages/freezed/lib/src/models.freezed.dart b/packages/freezed/lib/src/models.freezed.dart index 85eb285a..e182134d 100644 --- a/packages/freezed/lib/src/models.freezed.dart +++ b/packages/freezed/lib/src/models.freezed.dart @@ -1,5 +1,6 @@ // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target part of 'models.dart'; @@ -14,30 +15,7 @@ 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'); /// @nodoc -class _$CloneablePropertyTearOff { - const _$CloneablePropertyTearOff(); - - _CloneableProperty call( - {required String name, - required String typeName, - required String type, - required bool nullable, - required GenericsParameterTemplate genericParameters}) { - return _CloneableProperty( - name: name, - typeName: typeName, - type: type, - nullable: nullable, - genericParameters: genericParameters, - ); - } -} - -/// @nodoc -const $CloneableProperty = _$CloneablePropertyTearOff(); - -/// @nodoc -mixin _$CloneableProperty { +mixin _$DeepCloneableProperty { String get name => throw _privateConstructorUsedError; String get typeName => throw _privateConstructorUsedError; String get type => throw _privateConstructorUsedError; @@ -46,15 +24,16 @@ mixin _$CloneableProperty { throw _privateConstructorUsedError; @JsonKey(ignore: true) - $CloneablePropertyCopyWith get copyWith => + $DeepCloneablePropertyCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $CloneablePropertyCopyWith<$Res> { - factory $CloneablePropertyCopyWith( - CloneableProperty value, $Res Function(CloneableProperty) then) = - _$CloneablePropertyCopyWithImpl<$Res>; +abstract class $DeepCloneablePropertyCopyWith<$Res> { + factory $DeepCloneablePropertyCopyWith(DeepCloneableProperty value, + $Res Function(DeepCloneableProperty) then) = + _$DeepCloneablePropertyCopyWithImpl<$Res, DeepCloneableProperty>; + @useResult $Res call( {String name, String typeName, @@ -64,54 +43,58 @@ abstract class $CloneablePropertyCopyWith<$Res> { } /// @nodoc -class _$CloneablePropertyCopyWithImpl<$Res> - implements $CloneablePropertyCopyWith<$Res> { - _$CloneablePropertyCopyWithImpl(this._value, this._then); +class _$DeepCloneablePropertyCopyWithImpl<$Res, + $Val extends DeepCloneableProperty> + implements $DeepCloneablePropertyCopyWith<$Res> { + _$DeepCloneablePropertyCopyWithImpl(this._value, this._then); - final CloneableProperty _value; // ignore: unused_field - final $Res Function(CloneableProperty) _then; + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + @pragma('vm:prefer-inline') @override $Res call({ - Object? name = freezed, - Object? typeName = freezed, - Object? type = freezed, - Object? nullable = freezed, - Object? genericParameters = freezed, + Object? name = null, + Object? typeName = null, + Object? type = null, + Object? nullable = null, + Object? genericParameters = null, }) { return _then(_value.copyWith( - name: name == freezed + name: null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, - typeName: typeName == freezed + typeName: null == typeName ? _value.typeName : typeName // ignore: cast_nullable_to_non_nullable as String, - type: type == freezed + type: null == type ? _value.type : type // ignore: cast_nullable_to_non_nullable as String, - nullable: nullable == freezed + nullable: null == nullable ? _value.nullable : nullable // ignore: cast_nullable_to_non_nullable as bool, - genericParameters: genericParameters == freezed + genericParameters: null == genericParameters ? _value.genericParameters : genericParameters // ignore: cast_nullable_to_non_nullable as GenericsParameterTemplate, - )); + ) as $Val); } } /// @nodoc -abstract class _$CloneablePropertyCopyWith<$Res> - implements $CloneablePropertyCopyWith<$Res> { - factory _$CloneablePropertyCopyWith( - _CloneableProperty value, $Res Function(_CloneableProperty) then) = - __$CloneablePropertyCopyWithImpl<$Res>; +abstract class _$$_DeepCloneablePropertyCopyWith<$Res> + implements $DeepCloneablePropertyCopyWith<$Res> { + factory _$$_DeepCloneablePropertyCopyWith(_$_DeepCloneableProperty value, + $Res Function(_$_DeepCloneableProperty) then) = + __$$_DeepCloneablePropertyCopyWithImpl<$Res>; @override + @useResult $Res call( {String name, String typeName, @@ -121,42 +104,40 @@ abstract class _$CloneablePropertyCopyWith<$Res> } /// @nodoc -class __$CloneablePropertyCopyWithImpl<$Res> - extends _$CloneablePropertyCopyWithImpl<$Res> - implements _$CloneablePropertyCopyWith<$Res> { - __$CloneablePropertyCopyWithImpl( - _CloneableProperty _value, $Res Function(_CloneableProperty) _then) - : super(_value, (v) => _then(v as _CloneableProperty)); - - @override - _CloneableProperty get _value => super._value as _CloneableProperty; +class __$$_DeepCloneablePropertyCopyWithImpl<$Res> + extends _$DeepCloneablePropertyCopyWithImpl<$Res, _$_DeepCloneableProperty> + implements _$$_DeepCloneablePropertyCopyWith<$Res> { + __$$_DeepCloneablePropertyCopyWithImpl(_$_DeepCloneableProperty _value, + $Res Function(_$_DeepCloneableProperty) _then) + : super(_value, _then); + @pragma('vm:prefer-inline') @override $Res call({ - Object? name = freezed, - Object? typeName = freezed, - Object? type = freezed, - Object? nullable = freezed, - Object? genericParameters = freezed, + Object? name = null, + Object? typeName = null, + Object? type = null, + Object? nullable = null, + Object? genericParameters = null, }) { - return _then(_CloneableProperty( - name: name == freezed + return _then(_$_DeepCloneableProperty( + name: null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, - typeName: typeName == freezed + typeName: null == typeName ? _value.typeName : typeName // ignore: cast_nullable_to_non_nullable as String, - type: type == freezed + type: null == type ? _value.type : type // ignore: cast_nullable_to_non_nullable as String, - nullable: nullable == freezed + nullable: null == nullable ? _value.nullable : nullable // ignore: cast_nullable_to_non_nullable as bool, - genericParameters: genericParameters == freezed + genericParameters: null == genericParameters ? _value.genericParameters : genericParameters // ignore: cast_nullable_to_non_nullable as GenericsParameterTemplate, @@ -166,8 +147,8 @@ class __$CloneablePropertyCopyWithImpl<$Res> /// @nodoc -class _$_CloneableProperty implements _CloneableProperty { - _$_CloneableProperty( +class _$_DeepCloneableProperty implements _DeepCloneableProperty { + _$_DeepCloneableProperty( {required this.name, required this.typeName, required this.type, @@ -187,14 +168,14 @@ class _$_CloneableProperty implements _CloneableProperty { @override String toString() { - return 'CloneableProperty(name: $name, typeName: $typeName, type: $type, nullable: $nullable, genericParameters: $genericParameters)'; + return 'DeepCloneableProperty(name: $name, typeName: $typeName, type: $type, nullable: $nullable, genericParameters: $genericParameters)'; } @override bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _CloneableProperty && + other is _$_DeepCloneableProperty && (identical(other.name, name) || other.name == name) && (identical(other.typeName, typeName) || other.typeName == typeName) && @@ -211,18 +192,20 @@ class _$_CloneableProperty implements _CloneableProperty { @JsonKey(ignore: true) @override - _$CloneablePropertyCopyWith<_CloneableProperty> get copyWith => - __$CloneablePropertyCopyWithImpl<_CloneableProperty>(this, _$identity); + @pragma('vm:prefer-inline') + _$$_DeepCloneablePropertyCopyWith<_$_DeepCloneableProperty> get copyWith => + __$$_DeepCloneablePropertyCopyWithImpl<_$_DeepCloneableProperty>( + this, _$identity); } -abstract class _CloneableProperty implements CloneableProperty { - factory _CloneableProperty( - {required String name, - required String typeName, - required String type, - required bool nullable, - required GenericsParameterTemplate genericParameters}) = - _$_CloneableProperty; +abstract class _DeepCloneableProperty implements DeepCloneableProperty { + factory _DeepCloneableProperty( + {required final String name, + required final String typeName, + required final String type, + required final bool nullable, + required final GenericsParameterTemplate genericParameters}) = + _$_DeepCloneableProperty; @override String get name; @@ -236,55 +219,10 @@ abstract class _CloneableProperty implements CloneableProperty { GenericsParameterTemplate get genericParameters; @override @JsonKey(ignore: true) - _$CloneablePropertyCopyWith<_CloneableProperty> get copyWith => + _$$_DeepCloneablePropertyCopyWith<_$_DeepCloneableProperty> get copyWith => throw _privateConstructorUsedError; } -/// @nodoc -class _$ConstructorDetailsTearOff { - const _$ConstructorDetailsTearOff(); - - _ConstructorDetails call( - {required String name, - required String unionValue, - required bool isConst, - required String redirectedName, - required ParametersTemplate parameters, - required List impliedProperties, - required bool isDefault, - required bool isFallback, - required bool hasJsonSerializable, - required String fullName, - required String escapedName, - required List withDecorators, - required List implementsDecorators, - required List decorators, - required List cloneableProperties, - required List asserts}) { - return _ConstructorDetails( - name: name, - unionValue: unionValue, - isConst: isConst, - redirectedName: redirectedName, - parameters: parameters, - impliedProperties: impliedProperties, - isDefault: isDefault, - isFallback: isFallback, - hasJsonSerializable: hasJsonSerializable, - fullName: fullName, - escapedName: escapedName, - withDecorators: withDecorators, - implementsDecorators: implementsDecorators, - decorators: decorators, - cloneableProperties: cloneableProperties, - asserts: asserts, - ); - } -} - -/// @nodoc -const $ConstructorDetails = _$ConstructorDetailsTearOff(); - /// @nodoc mixin _$ConstructorDetails { String get name => throw _privateConstructorUsedError; @@ -301,7 +239,7 @@ mixin _$ConstructorDetails { List get withDecorators => throw _privateConstructorUsedError; List get implementsDecorators => throw _privateConstructorUsedError; List get decorators => throw _privateConstructorUsedError; - List get cloneableProperties => + List get cloneableProperties => throw _privateConstructorUsedError; List get asserts => throw _privateConstructorUsedError; @@ -314,7 +252,8 @@ mixin _$ConstructorDetails { abstract class $ConstructorDetailsCopyWith<$Res> { factory $ConstructorDetailsCopyWith( ConstructorDetails value, $Res Function(ConstructorDetails) then) = - _$ConstructorDetailsCopyWithImpl<$Res>; + _$ConstructorDetailsCopyWithImpl<$Res, ConstructorDetails>; + @useResult $Res call( {String name, String unionValue, @@ -330,114 +269,117 @@ abstract class $ConstructorDetailsCopyWith<$Res> { List withDecorators, List implementsDecorators, List decorators, - List cloneableProperties, + List cloneableProperties, List asserts}); } /// @nodoc -class _$ConstructorDetailsCopyWithImpl<$Res> +class _$ConstructorDetailsCopyWithImpl<$Res, $Val extends ConstructorDetails> implements $ConstructorDetailsCopyWith<$Res> { _$ConstructorDetailsCopyWithImpl(this._value, this._then); - final ConstructorDetails _value; // ignore: unused_field - final $Res Function(ConstructorDetails) _then; + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + @pragma('vm:prefer-inline') @override $Res call({ - Object? name = freezed, - Object? unionValue = freezed, - Object? isConst = freezed, - Object? redirectedName = freezed, - Object? parameters = freezed, - Object? impliedProperties = freezed, - Object? isDefault = freezed, - Object? isFallback = freezed, - Object? hasJsonSerializable = freezed, - Object? fullName = freezed, - Object? escapedName = freezed, - Object? withDecorators = freezed, - Object? implementsDecorators = freezed, - Object? decorators = freezed, - Object? cloneableProperties = freezed, - Object? asserts = freezed, + Object? name = null, + Object? unionValue = null, + Object? isConst = null, + Object? redirectedName = null, + Object? parameters = null, + Object? impliedProperties = null, + Object? isDefault = null, + Object? isFallback = null, + Object? hasJsonSerializable = null, + Object? fullName = null, + Object? escapedName = null, + Object? withDecorators = null, + Object? implementsDecorators = null, + Object? decorators = null, + Object? cloneableProperties = null, + Object? asserts = null, }) { return _then(_value.copyWith( - name: name == freezed + name: null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, - unionValue: unionValue == freezed + unionValue: null == unionValue ? _value.unionValue : unionValue // ignore: cast_nullable_to_non_nullable as String, - isConst: isConst == freezed + isConst: null == isConst ? _value.isConst : isConst // ignore: cast_nullable_to_non_nullable as bool, - redirectedName: redirectedName == freezed + redirectedName: null == redirectedName ? _value.redirectedName : redirectedName // ignore: cast_nullable_to_non_nullable as String, - parameters: parameters == freezed + parameters: null == parameters ? _value.parameters : parameters // ignore: cast_nullable_to_non_nullable as ParametersTemplate, - impliedProperties: impliedProperties == freezed + impliedProperties: null == impliedProperties ? _value.impliedProperties : impliedProperties // ignore: cast_nullable_to_non_nullable as List, - isDefault: isDefault == freezed + isDefault: null == isDefault ? _value.isDefault : isDefault // ignore: cast_nullable_to_non_nullable as bool, - isFallback: isFallback == freezed + isFallback: null == isFallback ? _value.isFallback : isFallback // ignore: cast_nullable_to_non_nullable as bool, - hasJsonSerializable: hasJsonSerializable == freezed + hasJsonSerializable: null == hasJsonSerializable ? _value.hasJsonSerializable : hasJsonSerializable // ignore: cast_nullable_to_non_nullable as bool, - fullName: fullName == freezed + fullName: null == fullName ? _value.fullName : fullName // ignore: cast_nullable_to_non_nullable as String, - escapedName: escapedName == freezed + escapedName: null == escapedName ? _value.escapedName : escapedName // ignore: cast_nullable_to_non_nullable as String, - withDecorators: withDecorators == freezed + withDecorators: null == withDecorators ? _value.withDecorators : withDecorators // ignore: cast_nullable_to_non_nullable as List, - implementsDecorators: implementsDecorators == freezed + implementsDecorators: null == implementsDecorators ? _value.implementsDecorators : implementsDecorators // ignore: cast_nullable_to_non_nullable as List, - decorators: decorators == freezed + decorators: null == decorators ? _value.decorators : decorators // ignore: cast_nullable_to_non_nullable as List, - cloneableProperties: cloneableProperties == freezed + cloneableProperties: null == cloneableProperties ? _value.cloneableProperties : cloneableProperties // ignore: cast_nullable_to_non_nullable - as List, - asserts: asserts == freezed + as List, + asserts: null == asserts ? _value.asserts : asserts // ignore: cast_nullable_to_non_nullable as List, - )); + ) as $Val); } } /// @nodoc -abstract class _$ConstructorDetailsCopyWith<$Res> +abstract class _$$_ConstructorDetailsCopyWith<$Res> implements $ConstructorDetailsCopyWith<$Res> { - factory _$ConstructorDetailsCopyWith( - _ConstructorDetails value, $Res Function(_ConstructorDetails) then) = - __$ConstructorDetailsCopyWithImpl<$Res>; + factory _$$_ConstructorDetailsCopyWith(_$_ConstructorDetails value, + $Res Function(_$_ConstructorDetails) then) = + __$$_ConstructorDetailsCopyWithImpl<$Res>; @override + @useResult $Res call( {String name, String unionValue, @@ -453,103 +395,101 @@ abstract class _$ConstructorDetailsCopyWith<$Res> List withDecorators, List implementsDecorators, List decorators, - List cloneableProperties, + List cloneableProperties, List asserts}); } /// @nodoc -class __$ConstructorDetailsCopyWithImpl<$Res> - extends _$ConstructorDetailsCopyWithImpl<$Res> - implements _$ConstructorDetailsCopyWith<$Res> { - __$ConstructorDetailsCopyWithImpl( - _ConstructorDetails _value, $Res Function(_ConstructorDetails) _then) - : super(_value, (v) => _then(v as _ConstructorDetails)); - - @override - _ConstructorDetails get _value => super._value as _ConstructorDetails; +class __$$_ConstructorDetailsCopyWithImpl<$Res> + extends _$ConstructorDetailsCopyWithImpl<$Res, _$_ConstructorDetails> + implements _$$_ConstructorDetailsCopyWith<$Res> { + __$$_ConstructorDetailsCopyWithImpl( + _$_ConstructorDetails _value, $Res Function(_$_ConstructorDetails) _then) + : super(_value, _then); + @pragma('vm:prefer-inline') @override $Res call({ - Object? name = freezed, - Object? unionValue = freezed, - Object? isConst = freezed, - Object? redirectedName = freezed, - Object? parameters = freezed, - Object? impliedProperties = freezed, - Object? isDefault = freezed, - Object? isFallback = freezed, - Object? hasJsonSerializable = freezed, - Object? fullName = freezed, - Object? escapedName = freezed, - Object? withDecorators = freezed, - Object? implementsDecorators = freezed, - Object? decorators = freezed, - Object? cloneableProperties = freezed, - Object? asserts = freezed, + Object? name = null, + Object? unionValue = null, + Object? isConst = null, + Object? redirectedName = null, + Object? parameters = null, + Object? impliedProperties = null, + Object? isDefault = null, + Object? isFallback = null, + Object? hasJsonSerializable = null, + Object? fullName = null, + Object? escapedName = null, + Object? withDecorators = null, + Object? implementsDecorators = null, + Object? decorators = null, + Object? cloneableProperties = null, + Object? asserts = null, }) { - return _then(_ConstructorDetails( - name: name == freezed + return _then(_$_ConstructorDetails( + name: null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, - unionValue: unionValue == freezed + unionValue: null == unionValue ? _value.unionValue : unionValue // ignore: cast_nullable_to_non_nullable as String, - isConst: isConst == freezed + isConst: null == isConst ? _value.isConst : isConst // ignore: cast_nullable_to_non_nullable as bool, - redirectedName: redirectedName == freezed + redirectedName: null == redirectedName ? _value.redirectedName : redirectedName // ignore: cast_nullable_to_non_nullable as String, - parameters: parameters == freezed + parameters: null == parameters ? _value.parameters : parameters // ignore: cast_nullable_to_non_nullable as ParametersTemplate, - impliedProperties: impliedProperties == freezed - ? _value.impliedProperties + impliedProperties: null == impliedProperties + ? _value._impliedProperties : impliedProperties // ignore: cast_nullable_to_non_nullable as List, - isDefault: isDefault == freezed + isDefault: null == isDefault ? _value.isDefault : isDefault // ignore: cast_nullable_to_non_nullable as bool, - isFallback: isFallback == freezed + isFallback: null == isFallback ? _value.isFallback : isFallback // ignore: cast_nullable_to_non_nullable as bool, - hasJsonSerializable: hasJsonSerializable == freezed + hasJsonSerializable: null == hasJsonSerializable ? _value.hasJsonSerializable : hasJsonSerializable // ignore: cast_nullable_to_non_nullable as bool, - fullName: fullName == freezed + fullName: null == fullName ? _value.fullName : fullName // ignore: cast_nullable_to_non_nullable as String, - escapedName: escapedName == freezed + escapedName: null == escapedName ? _value.escapedName : escapedName // ignore: cast_nullable_to_non_nullable as String, - withDecorators: withDecorators == freezed - ? _value.withDecorators + withDecorators: null == withDecorators + ? _value._withDecorators : withDecorators // ignore: cast_nullable_to_non_nullable as List, - implementsDecorators: implementsDecorators == freezed - ? _value.implementsDecorators + implementsDecorators: null == implementsDecorators + ? _value._implementsDecorators : implementsDecorators // ignore: cast_nullable_to_non_nullable as List, - decorators: decorators == freezed - ? _value.decorators + decorators: null == decorators + ? _value._decorators : decorators // ignore: cast_nullable_to_non_nullable as List, - cloneableProperties: cloneableProperties == freezed - ? _value.cloneableProperties + cloneableProperties: null == cloneableProperties + ? _value._cloneableProperties : cloneableProperties // ignore: cast_nullable_to_non_nullable - as List, - asserts: asserts == freezed - ? _value.asserts + as List, + asserts: null == asserts + ? _value._asserts : asserts // ignore: cast_nullable_to_non_nullable as List, )); @@ -565,18 +505,24 @@ class _$_ConstructorDetails extends _ConstructorDetails { required this.isConst, required this.redirectedName, required this.parameters, - required this.impliedProperties, + required final List impliedProperties, required this.isDefault, required this.isFallback, required this.hasJsonSerializable, required this.fullName, required this.escapedName, - required this.withDecorators, - required this.implementsDecorators, - required this.decorators, - required this.cloneableProperties, - required this.asserts}) - : super._(); + required final List withDecorators, + required final List implementsDecorators, + required final List decorators, + required final List cloneableProperties, + required final List asserts}) + : _impliedProperties = impliedProperties, + _withDecorators = withDecorators, + _implementsDecorators = implementsDecorators, + _decorators = decorators, + _cloneableProperties = cloneableProperties, + _asserts = asserts, + super._(); @override final String name; @@ -588,8 +534,13 @@ class _$_ConstructorDetails extends _ConstructorDetails { final String redirectedName; @override final ParametersTemplate parameters; + final List _impliedProperties; @override - final List impliedProperties; + List get impliedProperties { + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_impliedProperties); + } + @override final bool isDefault; @override @@ -600,16 +551,40 @@ class _$_ConstructorDetails extends _ConstructorDetails { final String fullName; @override final String escapedName; + final List _withDecorators; @override - final List withDecorators; + List get withDecorators { + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_withDecorators); + } + + final List _implementsDecorators; @override - final List implementsDecorators; + List get implementsDecorators { + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_implementsDecorators); + } + + final List _decorators; @override - final List decorators; + List get decorators { + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_decorators); + } + + final List _cloneableProperties; @override - final List cloneableProperties; + List get cloneableProperties { + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_cloneableProperties); + } + + final List _asserts; @override - final List asserts; + List get asserts { + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_asserts); + } @override String toString() { @@ -620,7 +595,7 @@ class _$_ConstructorDetails extends _ConstructorDetails { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _ConstructorDetails && + other is _$_ConstructorDetails && (identical(other.name, name) || other.name == name) && (identical(other.unionValue, unionValue) || other.unionValue == unionValue) && @@ -630,7 +605,7 @@ class _$_ConstructorDetails extends _ConstructorDetails { (identical(other.parameters, parameters) || other.parameters == parameters) && const DeepCollectionEquality() - .equals(other.impliedProperties, impliedProperties) && + .equals(other._impliedProperties, _impliedProperties) && (identical(other.isDefault, isDefault) || other.isDefault == isDefault) && (identical(other.isFallback, isFallback) || @@ -642,14 +617,14 @@ class _$_ConstructorDetails extends _ConstructorDetails { (identical(other.escapedName, escapedName) || other.escapedName == escapedName) && const DeepCollectionEquality() - .equals(other.withDecorators, withDecorators) && + .equals(other._withDecorators, _withDecorators) && const DeepCollectionEquality() - .equals(other.implementsDecorators, implementsDecorators) && + .equals(other._implementsDecorators, _implementsDecorators) && const DeepCollectionEquality() - .equals(other.decorators, decorators) && + .equals(other._decorators, _decorators) && const DeepCollectionEquality() - .equals(other.cloneableProperties, cloneableProperties) && - const DeepCollectionEquality().equals(other.asserts, asserts)); + .equals(other._cloneableProperties, _cloneableProperties) && + const DeepCollectionEquality().equals(other._asserts, _asserts)); } @override @@ -660,42 +635,44 @@ class _$_ConstructorDetails extends _ConstructorDetails { isConst, redirectedName, parameters, - const DeepCollectionEquality().hash(impliedProperties), + const DeepCollectionEquality().hash(_impliedProperties), isDefault, isFallback, hasJsonSerializable, fullName, escapedName, - const DeepCollectionEquality().hash(withDecorators), - const DeepCollectionEquality().hash(implementsDecorators), - const DeepCollectionEquality().hash(decorators), - const DeepCollectionEquality().hash(cloneableProperties), - const DeepCollectionEquality().hash(asserts)); + const DeepCollectionEquality().hash(_withDecorators), + const DeepCollectionEquality().hash(_implementsDecorators), + const DeepCollectionEquality().hash(_decorators), + const DeepCollectionEquality().hash(_cloneableProperties), + const DeepCollectionEquality().hash(_asserts)); @JsonKey(ignore: true) @override - _$ConstructorDetailsCopyWith<_ConstructorDetails> get copyWith => - __$ConstructorDetailsCopyWithImpl<_ConstructorDetails>(this, _$identity); + @pragma('vm:prefer-inline') + _$$_ConstructorDetailsCopyWith<_$_ConstructorDetails> get copyWith => + __$$_ConstructorDetailsCopyWithImpl<_$_ConstructorDetails>( + this, _$identity); } abstract class _ConstructorDetails extends ConstructorDetails { factory _ConstructorDetails( - {required String name, - required String unionValue, - required bool isConst, - required String redirectedName, - required ParametersTemplate parameters, - required List impliedProperties, - required bool isDefault, - required bool isFallback, - required bool hasJsonSerializable, - required String fullName, - required String escapedName, - required List withDecorators, - required List implementsDecorators, - required List decorators, - required List cloneableProperties, - required List asserts}) = _$_ConstructorDetails; + {required final String name, + required final String unionValue, + required final bool isConst, + required final String redirectedName, + required final ParametersTemplate parameters, + required final List impliedProperties, + required final bool isDefault, + required final bool isFallback, + required final bool hasJsonSerializable, + required final String fullName, + required final String escapedName, + required final List withDecorators, + required final List implementsDecorators, + required final List decorators, + required final List cloneableProperties, + required final List asserts}) = _$_ConstructorDetails; _ConstructorDetails._() : super._(); @override @@ -727,32 +704,15 @@ abstract class _ConstructorDetails extends ConstructorDetails { @override List get decorators; @override - List get cloneableProperties; + List get cloneableProperties; @override List get asserts; @override @JsonKey(ignore: true) - _$ConstructorDetailsCopyWith<_ConstructorDetails> get copyWith => + _$$_ConstructorDetailsCopyWith<_$_ConstructorDetails> get copyWith => throw _privateConstructorUsedError; } -/// @nodoc -class _$MapConfigTearOff { - const _$MapConfigTearOff(); - - _MapConfig call( - {required bool map, required bool mapOrNull, required bool maybeMap}) { - return _MapConfig( - map: map, - mapOrNull: mapOrNull, - maybeMap: maybeMap, - ); - } -} - -/// @nodoc -const $MapConfig = _$MapConfigTearOff(); - /// @nodoc mixin _$MapConfig { bool get map => throw _privateConstructorUsedError; @@ -767,75 +727,80 @@ mixin _$MapConfig { /// @nodoc abstract class $MapConfigCopyWith<$Res> { factory $MapConfigCopyWith(MapConfig value, $Res Function(MapConfig) then) = - _$MapConfigCopyWithImpl<$Res>; + _$MapConfigCopyWithImpl<$Res, MapConfig>; + @useResult $Res call({bool map, bool mapOrNull, bool maybeMap}); } /// @nodoc -class _$MapConfigCopyWithImpl<$Res> implements $MapConfigCopyWith<$Res> { +class _$MapConfigCopyWithImpl<$Res, $Val extends MapConfig> + implements $MapConfigCopyWith<$Res> { _$MapConfigCopyWithImpl(this._value, this._then); - final MapConfig _value; // ignore: unused_field - final $Res Function(MapConfig) _then; + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + @pragma('vm:prefer-inline') @override $Res call({ - Object? map = freezed, - Object? mapOrNull = freezed, - Object? maybeMap = freezed, + Object? map = null, + Object? mapOrNull = null, + Object? maybeMap = null, }) { return _then(_value.copyWith( - map: map == freezed + map: null == map ? _value.map : map // ignore: cast_nullable_to_non_nullable as bool, - mapOrNull: mapOrNull == freezed + mapOrNull: null == mapOrNull ? _value.mapOrNull : mapOrNull // ignore: cast_nullable_to_non_nullable as bool, - maybeMap: maybeMap == freezed + maybeMap: null == maybeMap ? _value.maybeMap : maybeMap // ignore: cast_nullable_to_non_nullable as bool, - )); + ) as $Val); } } /// @nodoc -abstract class _$MapConfigCopyWith<$Res> implements $MapConfigCopyWith<$Res> { - factory _$MapConfigCopyWith( - _MapConfig value, $Res Function(_MapConfig) then) = - __$MapConfigCopyWithImpl<$Res>; +abstract class _$$_MapConfigCopyWith<$Res> implements $MapConfigCopyWith<$Res> { + factory _$$_MapConfigCopyWith( + _$_MapConfig value, $Res Function(_$_MapConfig) then) = + __$$_MapConfigCopyWithImpl<$Res>; @override + @useResult $Res call({bool map, bool mapOrNull, bool maybeMap}); } /// @nodoc -class __$MapConfigCopyWithImpl<$Res> extends _$MapConfigCopyWithImpl<$Res> - implements _$MapConfigCopyWith<$Res> { - __$MapConfigCopyWithImpl(_MapConfig _value, $Res Function(_MapConfig) _then) - : super(_value, (v) => _then(v as _MapConfig)); - - @override - _MapConfig get _value => super._value as _MapConfig; +class __$$_MapConfigCopyWithImpl<$Res> + extends _$MapConfigCopyWithImpl<$Res, _$_MapConfig> + implements _$$_MapConfigCopyWith<$Res> { + __$$_MapConfigCopyWithImpl( + _$_MapConfig _value, $Res Function(_$_MapConfig) _then) + : super(_value, _then); + @pragma('vm:prefer-inline') @override $Res call({ - Object? map = freezed, - Object? mapOrNull = freezed, - Object? maybeMap = freezed, + Object? map = null, + Object? mapOrNull = null, + Object? maybeMap = null, }) { - return _then(_MapConfig( - map: map == freezed + return _then(_$_MapConfig( + map: null == map ? _value.map : map // ignore: cast_nullable_to_non_nullable as bool, - mapOrNull: mapOrNull == freezed + mapOrNull: null == mapOrNull ? _value.mapOrNull : mapOrNull // ignore: cast_nullable_to_non_nullable as bool, - maybeMap: maybeMap == freezed + maybeMap: null == maybeMap ? _value.maybeMap : maybeMap // ignore: cast_nullable_to_non_nullable as bool, @@ -865,7 +830,7 @@ class _$_MapConfig implements _MapConfig { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _MapConfig && + other is _$_MapConfig && (identical(other.map, map) || other.map == map) && (identical(other.mapOrNull, mapOrNull) || other.mapOrNull == mapOrNull) && @@ -878,15 +843,16 @@ class _$_MapConfig implements _MapConfig { @JsonKey(ignore: true) @override - _$MapConfigCopyWith<_MapConfig> get copyWith => - __$MapConfigCopyWithImpl<_MapConfig>(this, _$identity); + @pragma('vm:prefer-inline') + _$$_MapConfigCopyWith<_$_MapConfig> get copyWith => + __$$_MapConfigCopyWithImpl<_$_MapConfig>(this, _$identity); } abstract class _MapConfig implements MapConfig { factory _MapConfig( - {required bool map, - required bool mapOrNull, - required bool maybeMap}) = _$_MapConfig; + {required final bool map, + required final bool mapOrNull, + required final bool maybeMap}) = _$_MapConfig; @override bool get map; @@ -896,27 +862,10 @@ abstract class _MapConfig implements MapConfig { bool get maybeMap; @override @JsonKey(ignore: true) - _$MapConfigCopyWith<_MapConfig> get copyWith => + _$$_MapConfigCopyWith<_$_MapConfig> get copyWith => throw _privateConstructorUsedError; } -/// @nodoc -class _$WhenConfigTearOff { - const _$WhenConfigTearOff(); - - _WhenConfig call( - {required bool when, required bool whenOrNull, required bool maybeWhen}) { - return _WhenConfig( - when: when, - whenOrNull: whenOrNull, - maybeWhen: maybeWhen, - ); - } -} - -/// @nodoc -const $WhenConfig = _$WhenConfigTearOff(); - /// @nodoc mixin _$WhenConfig { bool get when => throw _privateConstructorUsedError; @@ -932,76 +881,81 @@ mixin _$WhenConfig { abstract class $WhenConfigCopyWith<$Res> { factory $WhenConfigCopyWith( WhenConfig value, $Res Function(WhenConfig) then) = - _$WhenConfigCopyWithImpl<$Res>; + _$WhenConfigCopyWithImpl<$Res, WhenConfig>; + @useResult $Res call({bool when, bool whenOrNull, bool maybeWhen}); } /// @nodoc -class _$WhenConfigCopyWithImpl<$Res> implements $WhenConfigCopyWith<$Res> { +class _$WhenConfigCopyWithImpl<$Res, $Val extends WhenConfig> + implements $WhenConfigCopyWith<$Res> { _$WhenConfigCopyWithImpl(this._value, this._then); - final WhenConfig _value; // ignore: unused_field - final $Res Function(WhenConfig) _then; + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + @pragma('vm:prefer-inline') @override $Res call({ - Object? when = freezed, - Object? whenOrNull = freezed, - Object? maybeWhen = freezed, + Object? when = null, + Object? whenOrNull = null, + Object? maybeWhen = null, }) { return _then(_value.copyWith( - when: when == freezed + when: null == when ? _value.when : when // ignore: cast_nullable_to_non_nullable as bool, - whenOrNull: whenOrNull == freezed + whenOrNull: null == whenOrNull ? _value.whenOrNull : whenOrNull // ignore: cast_nullable_to_non_nullable as bool, - maybeWhen: maybeWhen == freezed + maybeWhen: null == maybeWhen ? _value.maybeWhen : maybeWhen // ignore: cast_nullable_to_non_nullable as bool, - )); + ) as $Val); } } /// @nodoc -abstract class _$WhenConfigCopyWith<$Res> implements $WhenConfigCopyWith<$Res> { - factory _$WhenConfigCopyWith( - _WhenConfig value, $Res Function(_WhenConfig) then) = - __$WhenConfigCopyWithImpl<$Res>; +abstract class _$$_WhenConfigCopyWith<$Res> + implements $WhenConfigCopyWith<$Res> { + factory _$$_WhenConfigCopyWith( + _$_WhenConfig value, $Res Function(_$_WhenConfig) then) = + __$$_WhenConfigCopyWithImpl<$Res>; @override + @useResult $Res call({bool when, bool whenOrNull, bool maybeWhen}); } /// @nodoc -class __$WhenConfigCopyWithImpl<$Res> extends _$WhenConfigCopyWithImpl<$Res> - implements _$WhenConfigCopyWith<$Res> { - __$WhenConfigCopyWithImpl( - _WhenConfig _value, $Res Function(_WhenConfig) _then) - : super(_value, (v) => _then(v as _WhenConfig)); - - @override - _WhenConfig get _value => super._value as _WhenConfig; +class __$$_WhenConfigCopyWithImpl<$Res> + extends _$WhenConfigCopyWithImpl<$Res, _$_WhenConfig> + implements _$$_WhenConfigCopyWith<$Res> { + __$$_WhenConfigCopyWithImpl( + _$_WhenConfig _value, $Res Function(_$_WhenConfig) _then) + : super(_value, _then); + @pragma('vm:prefer-inline') @override $Res call({ - Object? when = freezed, - Object? whenOrNull = freezed, - Object? maybeWhen = freezed, + Object? when = null, + Object? whenOrNull = null, + Object? maybeWhen = null, }) { - return _then(_WhenConfig( - when: when == freezed + return _then(_$_WhenConfig( + when: null == when ? _value.when : when // ignore: cast_nullable_to_non_nullable as bool, - whenOrNull: whenOrNull == freezed + whenOrNull: null == whenOrNull ? _value.whenOrNull : whenOrNull // ignore: cast_nullable_to_non_nullable as bool, - maybeWhen: maybeWhen == freezed + maybeWhen: null == maybeWhen ? _value.maybeWhen : maybeWhen // ignore: cast_nullable_to_non_nullable as bool, @@ -1031,7 +985,7 @@ class _$_WhenConfig implements _WhenConfig { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _WhenConfig && + other is _$_WhenConfig && (identical(other.when, when) || other.when == when) && (identical(other.whenOrNull, whenOrNull) || other.whenOrNull == whenOrNull) && @@ -1044,15 +998,16 @@ class _$_WhenConfig implements _WhenConfig { @JsonKey(ignore: true) @override - _$WhenConfigCopyWith<_WhenConfig> get copyWith => - __$WhenConfigCopyWithImpl<_WhenConfig>(this, _$identity); + @pragma('vm:prefer-inline') + _$$_WhenConfigCopyWith<_$_WhenConfig> get copyWith => + __$$_WhenConfigCopyWithImpl<_$_WhenConfig>(this, _$identity); } abstract class _WhenConfig implements WhenConfig { factory _WhenConfig( - {required bool when, - required bool whenOrNull, - required bool maybeWhen}) = _$_WhenConfig; + {required final bool when, + required final bool whenOrNull, + required final bool maybeWhen}) = _$_WhenConfig; @override bool get when; @@ -1062,55 +1017,10 @@ abstract class _WhenConfig implements WhenConfig { bool get maybeWhen; @override @JsonKey(ignore: true) - _$WhenConfigCopyWith<_WhenConfig> get copyWith => + _$$_WhenConfigCopyWith<_$_WhenConfig> get copyWith => throw _privateConstructorUsedError; } -/// @nodoc -class _$DataTearOff { - const _$DataTearOff(); - - _Data call( - {required String name, - required String unionKey, - required bool generateCopyWith, - required bool generateEqual, - required bool generateToString, - required MapConfig map, - required WhenConfig when, - required bool generateFromJson, - required bool generateToJson, - required bool makeCollectionsImmutable, - required List concretePropertiesName, - required List constructors, - required GenericsDefinitionTemplate genericsDefinitionTemplate, - required GenericsParameterTemplate genericsParameterTemplate, - required bool shouldUseExtends, - required bool genericArgumentFactories}) { - return _Data( - name: name, - unionKey: unionKey, - generateCopyWith: generateCopyWith, - generateEqual: generateEqual, - generateToString: generateToString, - map: map, - when: when, - generateFromJson: generateFromJson, - generateToJson: generateToJson, - makeCollectionsImmutable: makeCollectionsImmutable, - concretePropertiesName: concretePropertiesName, - constructors: constructors, - genericsDefinitionTemplate: genericsDefinitionTemplate, - genericsParameterTemplate: genericsParameterTemplate, - shouldUseExtends: shouldUseExtends, - genericArgumentFactories: genericArgumentFactories, - ); - } -} - -/// @nodoc -const $Data = _$DataTearOff(); - /// @nodoc mixin _$Data { String get name => throw _privateConstructorUsedError; @@ -1140,7 +1050,8 @@ mixin _$Data { /// @nodoc abstract class $DataCopyWith<$Res> { factory $DataCopyWith(Data value, $Res Function(Data) then) = - _$DataCopyWithImpl<$Res>; + _$DataCopyWithImpl<$Res, Data>; + @useResult $Res call( {String name, String unionKey, @@ -1164,120 +1075,126 @@ abstract class $DataCopyWith<$Res> { } /// @nodoc -class _$DataCopyWithImpl<$Res> implements $DataCopyWith<$Res> { +class _$DataCopyWithImpl<$Res, $Val extends Data> + implements $DataCopyWith<$Res> { _$DataCopyWithImpl(this._value, this._then); - final Data _value; // ignore: unused_field - final $Res Function(Data) _then; + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + @pragma('vm:prefer-inline') @override $Res call({ - Object? name = freezed, - Object? unionKey = freezed, - Object? generateCopyWith = freezed, - Object? generateEqual = freezed, - Object? generateToString = freezed, - Object? map = freezed, - Object? when = freezed, - Object? generateFromJson = freezed, - Object? generateToJson = freezed, - Object? makeCollectionsImmutable = freezed, - Object? concretePropertiesName = freezed, - Object? constructors = freezed, - Object? genericsDefinitionTemplate = freezed, - Object? genericsParameterTemplate = freezed, - Object? shouldUseExtends = freezed, - Object? genericArgumentFactories = freezed, + Object? name = null, + Object? unionKey = null, + Object? generateCopyWith = null, + Object? generateEqual = null, + Object? generateToString = null, + Object? map = null, + Object? when = null, + Object? generateFromJson = null, + Object? generateToJson = null, + Object? makeCollectionsImmutable = null, + Object? concretePropertiesName = null, + Object? constructors = null, + Object? genericsDefinitionTemplate = null, + Object? genericsParameterTemplate = null, + Object? shouldUseExtends = null, + Object? genericArgumentFactories = null, }) { return _then(_value.copyWith( - name: name == freezed + name: null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, - unionKey: unionKey == freezed + unionKey: null == unionKey ? _value.unionKey : unionKey // ignore: cast_nullable_to_non_nullable as String, - generateCopyWith: generateCopyWith == freezed + generateCopyWith: null == generateCopyWith ? _value.generateCopyWith : generateCopyWith // ignore: cast_nullable_to_non_nullable as bool, - generateEqual: generateEqual == freezed + generateEqual: null == generateEqual ? _value.generateEqual : generateEqual // ignore: cast_nullable_to_non_nullable as bool, - generateToString: generateToString == freezed + generateToString: null == generateToString ? _value.generateToString : generateToString // ignore: cast_nullable_to_non_nullable as bool, - map: map == freezed + map: null == map ? _value.map : map // ignore: cast_nullable_to_non_nullable as MapConfig, - when: when == freezed + when: null == when ? _value.when : when // ignore: cast_nullable_to_non_nullable as WhenConfig, - generateFromJson: generateFromJson == freezed + generateFromJson: null == generateFromJson ? _value.generateFromJson : generateFromJson // ignore: cast_nullable_to_non_nullable as bool, - generateToJson: generateToJson == freezed + generateToJson: null == generateToJson ? _value.generateToJson : generateToJson // ignore: cast_nullable_to_non_nullable as bool, - makeCollectionsImmutable: makeCollectionsImmutable == freezed + makeCollectionsImmutable: null == makeCollectionsImmutable ? _value.makeCollectionsImmutable : makeCollectionsImmutable // ignore: cast_nullable_to_non_nullable as bool, - concretePropertiesName: concretePropertiesName == freezed + concretePropertiesName: null == concretePropertiesName ? _value.concretePropertiesName : concretePropertiesName // ignore: cast_nullable_to_non_nullable as List, - constructors: constructors == freezed + constructors: null == constructors ? _value.constructors : constructors // ignore: cast_nullable_to_non_nullable as List, - genericsDefinitionTemplate: genericsDefinitionTemplate == freezed + genericsDefinitionTemplate: null == genericsDefinitionTemplate ? _value.genericsDefinitionTemplate : genericsDefinitionTemplate // ignore: cast_nullable_to_non_nullable as GenericsDefinitionTemplate, - genericsParameterTemplate: genericsParameterTemplate == freezed + genericsParameterTemplate: null == genericsParameterTemplate ? _value.genericsParameterTemplate : genericsParameterTemplate // ignore: cast_nullable_to_non_nullable as GenericsParameterTemplate, - shouldUseExtends: shouldUseExtends == freezed + shouldUseExtends: null == shouldUseExtends ? _value.shouldUseExtends : shouldUseExtends // ignore: cast_nullable_to_non_nullable as bool, - genericArgumentFactories: genericArgumentFactories == freezed + genericArgumentFactories: null == genericArgumentFactories ? _value.genericArgumentFactories : genericArgumentFactories // ignore: cast_nullable_to_non_nullable as bool, - )); + ) as $Val); } @override + @pragma('vm:prefer-inline') $MapConfigCopyWith<$Res> get map { return $MapConfigCopyWith<$Res>(_value.map, (value) { - return _then(_value.copyWith(map: value)); + return _then(_value.copyWith(map: value) as $Val); }); } @override + @pragma('vm:prefer-inline') $WhenConfigCopyWith<$Res> get when { return $WhenConfigCopyWith<$Res>(_value.when, (value) { - return _then(_value.copyWith(when: value)); + return _then(_value.copyWith(when: value) as $Val); }); } } /// @nodoc -abstract class _$DataCopyWith<$Res> implements $DataCopyWith<$Res> { - factory _$DataCopyWith(_Data value, $Res Function(_Data) then) = - __$DataCopyWithImpl<$Res>; +abstract class _$$_DataCopyWith<$Res> implements $DataCopyWith<$Res> { + factory _$$_DataCopyWith(_$_Data value, $Res Function(_$_Data) then) = + __$$_DataCopyWithImpl<$Res>; @override + @useResult $Res call( {String name, String unionKey, @@ -1303,95 +1220,93 @@ abstract class _$DataCopyWith<$Res> implements $DataCopyWith<$Res> { } /// @nodoc -class __$DataCopyWithImpl<$Res> extends _$DataCopyWithImpl<$Res> - implements _$DataCopyWith<$Res> { - __$DataCopyWithImpl(_Data _value, $Res Function(_Data) _then) - : super(_value, (v) => _then(v as _Data)); - - @override - _Data get _value => super._value as _Data; +class __$$_DataCopyWithImpl<$Res> extends _$DataCopyWithImpl<$Res, _$_Data> + implements _$$_DataCopyWith<$Res> { + __$$_DataCopyWithImpl(_$_Data _value, $Res Function(_$_Data) _then) + : super(_value, _then); + @pragma('vm:prefer-inline') @override $Res call({ - Object? name = freezed, - Object? unionKey = freezed, - Object? generateCopyWith = freezed, - Object? generateEqual = freezed, - Object? generateToString = freezed, - Object? map = freezed, - Object? when = freezed, - Object? generateFromJson = freezed, - Object? generateToJson = freezed, - Object? makeCollectionsImmutable = freezed, - Object? concretePropertiesName = freezed, - Object? constructors = freezed, - Object? genericsDefinitionTemplate = freezed, - Object? genericsParameterTemplate = freezed, - Object? shouldUseExtends = freezed, - Object? genericArgumentFactories = freezed, + Object? name = null, + Object? unionKey = null, + Object? generateCopyWith = null, + Object? generateEqual = null, + Object? generateToString = null, + Object? map = null, + Object? when = null, + Object? generateFromJson = null, + Object? generateToJson = null, + Object? makeCollectionsImmutable = null, + Object? concretePropertiesName = null, + Object? constructors = null, + Object? genericsDefinitionTemplate = null, + Object? genericsParameterTemplate = null, + Object? shouldUseExtends = null, + Object? genericArgumentFactories = null, }) { - return _then(_Data( - name: name == freezed + return _then(_$_Data( + name: null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, - unionKey: unionKey == freezed + unionKey: null == unionKey ? _value.unionKey : unionKey // ignore: cast_nullable_to_non_nullable as String, - generateCopyWith: generateCopyWith == freezed + generateCopyWith: null == generateCopyWith ? _value.generateCopyWith : generateCopyWith // ignore: cast_nullable_to_non_nullable as bool, - generateEqual: generateEqual == freezed + generateEqual: null == generateEqual ? _value.generateEqual : generateEqual // ignore: cast_nullable_to_non_nullable as bool, - generateToString: generateToString == freezed + generateToString: null == generateToString ? _value.generateToString : generateToString // ignore: cast_nullable_to_non_nullable as bool, - map: map == freezed + map: null == map ? _value.map : map // ignore: cast_nullable_to_non_nullable as MapConfig, - when: when == freezed + when: null == when ? _value.when : when // ignore: cast_nullable_to_non_nullable as WhenConfig, - generateFromJson: generateFromJson == freezed + generateFromJson: null == generateFromJson ? _value.generateFromJson : generateFromJson // ignore: cast_nullable_to_non_nullable as bool, - generateToJson: generateToJson == freezed + generateToJson: null == generateToJson ? _value.generateToJson : generateToJson // ignore: cast_nullable_to_non_nullable as bool, - makeCollectionsImmutable: makeCollectionsImmutable == freezed + makeCollectionsImmutable: null == makeCollectionsImmutable ? _value.makeCollectionsImmutable : makeCollectionsImmutable // ignore: cast_nullable_to_non_nullable as bool, - concretePropertiesName: concretePropertiesName == freezed - ? _value.concretePropertiesName + concretePropertiesName: null == concretePropertiesName + ? _value._concretePropertiesName : concretePropertiesName // ignore: cast_nullable_to_non_nullable as List, - constructors: constructors == freezed - ? _value.constructors + constructors: null == constructors + ? _value._constructors : constructors // ignore: cast_nullable_to_non_nullable as List, - genericsDefinitionTemplate: genericsDefinitionTemplate == freezed + genericsDefinitionTemplate: null == genericsDefinitionTemplate ? _value.genericsDefinitionTemplate : genericsDefinitionTemplate // ignore: cast_nullable_to_non_nullable as GenericsDefinitionTemplate, - genericsParameterTemplate: genericsParameterTemplate == freezed + genericsParameterTemplate: null == genericsParameterTemplate ? _value.genericsParameterTemplate : genericsParameterTemplate // ignore: cast_nullable_to_non_nullable as GenericsParameterTemplate, - shouldUseExtends: shouldUseExtends == freezed + shouldUseExtends: null == shouldUseExtends ? _value.shouldUseExtends : shouldUseExtends // ignore: cast_nullable_to_non_nullable as bool, - genericArgumentFactories: genericArgumentFactories == freezed + genericArgumentFactories: null == genericArgumentFactories ? _value.genericArgumentFactories : genericArgumentFactories // ignore: cast_nullable_to_non_nullable as bool, @@ -1413,13 +1328,15 @@ class _$_Data implements _Data { required this.generateFromJson, required this.generateToJson, required this.makeCollectionsImmutable, - required this.concretePropertiesName, - required this.constructors, + required final List concretePropertiesName, + required final List constructors, required this.genericsDefinitionTemplate, required this.genericsParameterTemplate, required this.shouldUseExtends, required this.genericArgumentFactories}) - : assert(constructors.isNotEmpty); + : assert(constructors.isNotEmpty), + _concretePropertiesName = concretePropertiesName, + _constructors = constructors; @override final String name; @@ -1441,10 +1358,20 @@ class _$_Data implements _Data { final bool generateToJson; @override final bool makeCollectionsImmutable; + final List _concretePropertiesName; @override - final List concretePropertiesName; + List get concretePropertiesName { + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_concretePropertiesName); + } + + final List _constructors; @override - final List constructors; + List get constructors { + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_constructors); + } + @override final GenericsDefinitionTemplate genericsDefinitionTemplate; @override @@ -1463,7 +1390,7 @@ class _$_Data implements _Data { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _Data && + other is _$_Data && (identical(other.name, name) || other.name == name) && (identical(other.unionKey, unionKey) || other.unionKey == unionKey) && @@ -1482,10 +1409,10 @@ class _$_Data implements _Data { (identical( other.makeCollectionsImmutable, makeCollectionsImmutable) || other.makeCollectionsImmutable == makeCollectionsImmutable) && + const DeepCollectionEquality().equals( + other._concretePropertiesName, _concretePropertiesName) && const DeepCollectionEquality() - .equals(other.concretePropertiesName, concretePropertiesName) && - const DeepCollectionEquality() - .equals(other.constructors, constructors) && + .equals(other._constructors, _constructors) && (identical(other.genericsDefinitionTemplate, genericsDefinitionTemplate) || other.genericsDefinitionTemplate == @@ -1513,8 +1440,8 @@ class _$_Data implements _Data { generateFromJson, generateToJson, makeCollectionsImmutable, - const DeepCollectionEquality().hash(concretePropertiesName), - const DeepCollectionEquality().hash(constructors), + const DeepCollectionEquality().hash(_concretePropertiesName), + const DeepCollectionEquality().hash(_constructors), genericsDefinitionTemplate, genericsParameterTemplate, shouldUseExtends, @@ -1522,28 +1449,29 @@ class _$_Data implements _Data { @JsonKey(ignore: true) @override - _$DataCopyWith<_Data> get copyWith => - __$DataCopyWithImpl<_Data>(this, _$identity); + @pragma('vm:prefer-inline') + _$$_DataCopyWith<_$_Data> get copyWith => + __$$_DataCopyWithImpl<_$_Data>(this, _$identity); } abstract class _Data implements Data { factory _Data( - {required String name, - required String unionKey, - required bool generateCopyWith, - required bool generateEqual, - required bool generateToString, - required MapConfig map, - required WhenConfig when, - required bool generateFromJson, - required bool generateToJson, - required bool makeCollectionsImmutable, - required List concretePropertiesName, - required List constructors, - required GenericsDefinitionTemplate genericsDefinitionTemplate, - required GenericsParameterTemplate genericsParameterTemplate, - required bool shouldUseExtends, - required bool genericArgumentFactories}) = _$_Data; + {required final String name, + required final String unionKey, + required final bool generateCopyWith, + required final bool generateEqual, + required final bool generateToString, + required final MapConfig map, + required final WhenConfig when, + required final bool generateFromJson, + required final bool generateToJson, + required final bool makeCollectionsImmutable, + required final List concretePropertiesName, + required final List constructors, + required final GenericsDefinitionTemplate genericsDefinitionTemplate, + required final GenericsParameterTemplate genericsParameterTemplate, + required final bool shouldUseExtends, + required final bool genericArgumentFactories}) = _$_Data; @override String get name; @@ -1579,24 +1507,9 @@ abstract class _Data implements Data { bool get genericArgumentFactories; @override @JsonKey(ignore: true) - _$DataCopyWith<_Data> get copyWith => throw _privateConstructorUsedError; + _$$_DataCopyWith<_$_Data> get copyWith => throw _privateConstructorUsedError; } -/// @nodoc -class _$GlobalDataTearOff { - const _$GlobalDataTearOff(); - - _GlobalData call({required bool hasJson, required bool hasDiagnostics}) { - return _GlobalData( - hasJson: hasJson, - hasDiagnostics: hasDiagnostics, - ); - } -} - -/// @nodoc -const $GlobalData = _$GlobalDataTearOff(); - /// @nodoc mixin _$GlobalData { bool get hasJson => throw _privateConstructorUsedError; @@ -1611,66 +1524,71 @@ mixin _$GlobalData { abstract class $GlobalDataCopyWith<$Res> { factory $GlobalDataCopyWith( GlobalData value, $Res Function(GlobalData) then) = - _$GlobalDataCopyWithImpl<$Res>; + _$GlobalDataCopyWithImpl<$Res, GlobalData>; + @useResult $Res call({bool hasJson, bool hasDiagnostics}); } /// @nodoc -class _$GlobalDataCopyWithImpl<$Res> implements $GlobalDataCopyWith<$Res> { +class _$GlobalDataCopyWithImpl<$Res, $Val extends GlobalData> + implements $GlobalDataCopyWith<$Res> { _$GlobalDataCopyWithImpl(this._value, this._then); - final GlobalData _value; // ignore: unused_field - final $Res Function(GlobalData) _then; + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + @pragma('vm:prefer-inline') @override $Res call({ - Object? hasJson = freezed, - Object? hasDiagnostics = freezed, + Object? hasJson = null, + Object? hasDiagnostics = null, }) { return _then(_value.copyWith( - hasJson: hasJson == freezed + hasJson: null == hasJson ? _value.hasJson : hasJson // ignore: cast_nullable_to_non_nullable as bool, - hasDiagnostics: hasDiagnostics == freezed + hasDiagnostics: null == hasDiagnostics ? _value.hasDiagnostics : hasDiagnostics // ignore: cast_nullable_to_non_nullable as bool, - )); + ) as $Val); } } /// @nodoc -abstract class _$GlobalDataCopyWith<$Res> implements $GlobalDataCopyWith<$Res> { - factory _$GlobalDataCopyWith( - _GlobalData value, $Res Function(_GlobalData) then) = - __$GlobalDataCopyWithImpl<$Res>; +abstract class _$$_GlobalDataCopyWith<$Res> + implements $GlobalDataCopyWith<$Res> { + factory _$$_GlobalDataCopyWith( + _$_GlobalData value, $Res Function(_$_GlobalData) then) = + __$$_GlobalDataCopyWithImpl<$Res>; @override + @useResult $Res call({bool hasJson, bool hasDiagnostics}); } /// @nodoc -class __$GlobalDataCopyWithImpl<$Res> extends _$GlobalDataCopyWithImpl<$Res> - implements _$GlobalDataCopyWith<$Res> { - __$GlobalDataCopyWithImpl( - _GlobalData _value, $Res Function(_GlobalData) _then) - : super(_value, (v) => _then(v as _GlobalData)); - - @override - _GlobalData get _value => super._value as _GlobalData; +class __$$_GlobalDataCopyWithImpl<$Res> + extends _$GlobalDataCopyWithImpl<$Res, _$_GlobalData> + implements _$$_GlobalDataCopyWith<$Res> { + __$$_GlobalDataCopyWithImpl( + _$_GlobalData _value, $Res Function(_$_GlobalData) _then) + : super(_value, _then); + @pragma('vm:prefer-inline') @override $Res call({ - Object? hasJson = freezed, - Object? hasDiagnostics = freezed, + Object? hasJson = null, + Object? hasDiagnostics = null, }) { - return _then(_GlobalData( - hasJson: hasJson == freezed + return _then(_$_GlobalData( + hasJson: null == hasJson ? _value.hasJson : hasJson // ignore: cast_nullable_to_non_nullable as bool, - hasDiagnostics: hasDiagnostics == freezed + hasDiagnostics: null == hasDiagnostics ? _value.hasDiagnostics : hasDiagnostics // ignore: cast_nullable_to_non_nullable as bool, @@ -1697,7 +1615,7 @@ class _$_GlobalData implements _GlobalData { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _GlobalData && + other is _$_GlobalData && (identical(other.hasJson, hasJson) || other.hasJson == hasJson) && (identical(other.hasDiagnostics, hasDiagnostics) || other.hasDiagnostics == hasDiagnostics)); @@ -1708,13 +1626,15 @@ class _$_GlobalData implements _GlobalData { @JsonKey(ignore: true) @override - _$GlobalDataCopyWith<_GlobalData> get copyWith => - __$GlobalDataCopyWithImpl<_GlobalData>(this, _$identity); + @pragma('vm:prefer-inline') + _$$_GlobalDataCopyWith<_$_GlobalData> get copyWith => + __$$_GlobalDataCopyWithImpl<_$_GlobalData>(this, _$identity); } abstract class _GlobalData implements GlobalData { - factory _GlobalData({required bool hasJson, required bool hasDiagnostics}) = - _$_GlobalData; + factory _GlobalData( + {required final bool hasJson, + required final bool hasDiagnostics}) = _$_GlobalData; @override bool get hasJson; @@ -1722,6 +1642,6 @@ abstract class _GlobalData implements GlobalData { bool get hasDiagnostics; @override @JsonKey(ignore: true) - _$GlobalDataCopyWith<_GlobalData> get copyWith => + _$$_GlobalDataCopyWith<_$_GlobalData> get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/freezed/lib/src/templates/abstract_template.dart b/packages/freezed/lib/src/templates/abstract_template.dart index e550dfdb..8fe3db33 100644 --- a/packages/freezed/lib/src/templates/abstract_template.dart +++ b/packages/freezed/lib/src/templates/abstract_template.dart @@ -41,7 +41,7 @@ ${copyWith?.abstractCopyWithGetter ?? ''} ${copyWith?.commonInterface ?? ''} -${copyWith?.commonContreteImpl(commonProperties) ?? ''} +${copyWith?.commonConcreteImpl ?? ''} '''; } diff --git a/packages/freezed/lib/src/templates/concrete_template.dart b/packages/freezed/lib/src/templates/concrete_template.dart index 2bbc7a59..260be950 100644 --- a/packages/freezed/lib/src/templates/concrete_template.dart +++ b/packages/freezed/lib/src/templates/concrete_template.dart @@ -135,6 +135,7 @@ ${copyWith?.abstractCopyWithGetter ?? ''} doc: '', isPossiblyDartCollection: false, showDefaultValue: false, + parameterElement: null, ); parameters = ParametersTemplate( diff --git a/packages/freezed/lib/src/templates/copy_with.dart b/packages/freezed/lib/src/templates/copy_with.dart index d1d93c81..d2211b0e 100644 --- a/packages/freezed/lib/src/templates/copy_with.dart +++ b/packages/freezed/lib/src/templates/copy_with.dart @@ -8,8 +8,9 @@ class CopyWith { required this.clonedClassName, required this.genericsDefinition, required this.genericsParameter, - required this.allProperties, required this.cloneableProperties, + required this.readableProperties, + required this.deepCloneableProperties, required this.data, this.parent, }); @@ -24,8 +25,9 @@ class CopyWith { final String clonedClassName; final GenericsDefinitionTemplate genericsDefinition; final GenericsParameterTemplate genericsParameter; - final List allProperties; - final List cloneableProperties; + final List cloneableProperties; + final List readableProperties; + final List deepCloneableProperties; final CopyWith? parent; final Data data; @@ -33,10 +35,11 @@ class CopyWith { /// if the raw collection can be accessed instead. bool get canAccessRawCollection => parent != null; - String get interface => _interface(appendGenericToFactory: false); - String get commonInterface => _interface(appendGenericToFactory: true); + String get interface => _deepCopyInterface(appendGenericToFactory: false); + String get commonInterface => + _deepCopyInterface(appendGenericToFactory: true); - String _interface({required bool appendGenericToFactory}) { + String _deepCopyInterface({required bool appendGenericToFactory}) { var implements = _hasSuperClass ? 'implements ${parent!._abstractClassName}${genericsParameter.append('\$Res')}' : ''; @@ -54,25 +57,40 @@ ${_abstractDeepCopyMethods().join()} }'''; } - bool get _hasSuperClass { - return parent != null && parent!.allProperties.isNotEmpty; + String get abstractCopyWithGetter { + if (cloneableProperties.isEmpty) return ''; + + return _maybeOverride( + ''' +@JsonKey(ignore: true) +$_abstractClassName${genericsParameter.append('$clonedClassName$genericsParameter')} get copyWith => throw $privConstUsedErrorVarName; +''', + ); } - String commonContreteImpl( - List commonProperties, - ) { + String get concreteCopyWithGetter { + if (cloneableProperties.isEmpty) return ''; + return ''' +@JsonKey(ignore: true) +@override +@pragma('vm:prefer-inline') +$_abstractClassName${genericsParameter.append('$clonedClassName$genericsParameter')} get copyWith => $_implClassName${genericsParameter.append('$clonedClassName$genericsParameter')}(this, _\$identity); +'''; + } + + String get commonConcreteImpl { var copyWith = ''; - if (allProperties.isNotEmpty) { + if (cloneableProperties.isNotEmpty) { final prototype = _concreteCopyWithPrototype( - properties: allProperties, + properties: cloneableProperties, methodName: 'call', ); final body = _copyWithMethodBody( parametersTemplate: ParametersTemplate( const [], - namedParameters: commonProperties.map((e) { + namedParameters: cloneableProperties.map((e) { return Parameter( decorators: e.decorators, name: e.name, @@ -87,6 +105,7 @@ ${_abstractDeepCopyMethods().join()} type: e.type, doc: e.doc, isPossiblyDartCollection: e.isPossiblyDartCollection, + parameterElement: null, ); }).toList(), ), @@ -113,30 +132,61 @@ ${_deepCopyMethods(isConcrete: false).join()} '''; } + /// The implementation of the callable class that contains both the copyWith + /// and the cloneable properties. + String concreteImpl(ParametersTemplate parametersTemplate) { + return ''' +/// @nodoc +class $_implClassName${genericsDefinition.append('\$Res')} extends ${parent!._implClassName}${genericsParameter.append('\$Res').append('$clonedClassName$genericsParameter')} implements $_abstractClassName${genericsParameter.append('\$Res')} { + $_implClassName($clonedClassName$genericsParameter _value, \$Res Function($clonedClassName$genericsParameter) _then) + : super(_value, _then); + + +${_copyWithMethod(parametersTemplate)} + +${_deepCopyMethods(isConcrete: true).join()} +}'''; + } + + bool get _hasSuperClass { + return parent != null && parent!.cloneableProperties.isNotEmpty; + } + Iterable _abstractDeepCopyMethods() sync* { - for (final cloneableProperty in cloneableProperties) { + for (final deepCloneableProperty in deepCloneableProperties) { var leading = ''; if (_hasSuperClass && - parent!.cloneableProperties - .any((c) => c.name == cloneableProperty.name)) { + parent!.deepCloneableProperties + .any((c) => c.name == deepCloneableProperty.name)) { leading = '@override '; } - final nullabilitySuffix = cloneableProperty.nullable ? '?' : ''; + final nullabilitySuffix = deepCloneableProperty.nullable ? '?' : ''; - yield '$leading${_clonerInterfaceFor(cloneableProperty)}$nullabilitySuffix get ${cloneableProperty.name};'; + yield '$leading${_clonerInterfaceFor(deepCloneableProperty)}$nullabilitySuffix get ${deepCloneableProperty.name};'; } } String _copyWithPrototype(String methodName) { - if (allProperties.isEmpty) return ''; + if (cloneableProperties.isEmpty) return ''; return _copyWithProtypeFor( methodName: methodName, - properties: allProperties, + properties: cloneableProperties, ); } + String _concreteCopyWithPrototype({ + required List properties, + required String methodName, + }) { + final parameters = properties.map((p) { + return 'Object? ${p.name} = ${_defaultValue(isNullable: p.isNullable)},'; + }).join(); + + return '\$Res $methodName({$parameters})'; + } + String _copyWithProtypeFor({ required String methodName, required List properties, @@ -153,32 +203,11 @@ $parameters '''); } - String get abstractCopyWithGetter { - if (allProperties.isEmpty) return ''; - - return _maybeOverride( - ''' -@JsonKey(ignore: true) -$_abstractClassName${genericsParameter.append('$clonedClassName$genericsParameter')} get copyWith => throw $privConstUsedErrorVarName; -''', - ); - } - - String get concreteCopyWithGetter { - if (allProperties.isEmpty) return ''; - return ''' -@JsonKey(ignore: true) -@override -@pragma('vm:prefer-inline') -$_abstractClassName${genericsParameter.append('$clonedClassName$genericsParameter')} get copyWith => $_implClassName${genericsParameter.append('$clonedClassName$genericsParameter')}(this, _\$identity); -'''; - } - String _copyWithMethod(ParametersTemplate parametersTemplate) { - if (allProperties.isEmpty) return ''; + if (cloneableProperties.isEmpty) return ''; final prototype = _concreteCopyWithPrototype( - properties: allProperties, + properties: cloneableProperties, methodName: 'call', ); @@ -210,19 +239,45 @@ $s'''; required String returnType, String returnCast = '', }) { - String parameterToValue(Parameter p) { - var propertyName = p.name; + String thisPropertyFor({ + required Property propertyGetterForCopyWithParameter, + required Parameter to, + }) { + var propertyName = to.name; if (canAccessRawCollection && - (p.isDartList || p.isDartMap || p.isDartSet) && + (to.isDartList || to.isDartMap || to.isDartSet) && data.makeCollectionsImmutable) { propertyName = '_$propertyName'; } - var ternary = - '${_defaultValue(isNullable: p.isNullable)} == ${p.name} ? $accessor.$propertyName : ${p.name} '; + + var cast = ''; + if (propertyGetterForCopyWithParameter.type != to.type) cast = '!'; + + return '$accessor.$propertyName$cast'; + } + + String parameterAssignmentFor(Parameter p) { + var result = '${p.name} '; if (p.type != 'Object?' && p.type != 'Object' && p.type != null) { - ternary += _ignoreLints('as ${p.type}'); + result += _ignoreLints('as ${p.type}'); } - return '$ternary,'; + + return result; + } + + String parameterToValue(Parameter p) { + final propertyGetterForCopyWithParameter = + readableProperties.firstWhere((element) => element.name == p.name); + + final condition = + '${_defaultValue(isNullable: p.isNullable)} == ${p.name}'; + + final thisProperty = thisPropertyFor( + propertyGetterForCopyWithParameter: propertyGetterForCopyWithParameter, + to: p, + ); + + return '$condition ? $thisProperty : ${parameterAssignmentFor(p)},'; } final constructorParameters = StringBuffer() @@ -245,40 +300,13 @@ $constructorParameters }'''; } - String _concreteCopyWithPrototype({ - required List properties, - required String methodName, - }) { - final parameters = properties.map((p) { - return 'Object? ${p.name} = ${_defaultValue(isNullable: p.isNullable)},'; - }).join(); - - return '\$Res $methodName({$parameters})'; - } - String get _implClassName => '_${_abstractClassName}Impl'; - /// The implementation of the callable class that contains both the copyWith - /// and the cloneable properties. - String concreteImpl(ParametersTemplate parametersTemplate) { - return ''' -/// @nodoc -class $_implClassName${genericsDefinition.append('\$Res')} extends ${parent!._implClassName}${genericsParameter.append('\$Res').append('$clonedClassName$genericsParameter')} implements $_abstractClassName${genericsParameter.append('\$Res')} { - $_implClassName($clonedClassName$genericsParameter _value, \$Res Function($clonedClassName$genericsParameter) _then) - : super(_value, _then); - - -${_copyWithMethod(parametersTemplate)} - -${_deepCopyMethods(isConcrete: true).join()} -}'''; - } - Iterable _deepCopyMethods({required bool isConcrete}) sync* { final toGenerateProperties = parent == null - ? cloneableProperties - : cloneableProperties.where((property) { - return !parent!.cloneableProperties + ? deepCloneableProperties + : deepCloneableProperties.where((property) { + return !parent!.deepCloneableProperties .any((p) => p.name == property.name); }); @@ -311,7 +339,7 @@ $returnType get ${cloneableProperty.name} { } } - String _clonerInterfaceFor(CloneableProperty cloneableProperty) { + String _clonerInterfaceFor(DeepCloneableProperty cloneableProperty) { final name = interfaceNameFrom(cloneableProperty.typeName); return '$name${cloneableProperty.genericParameters.append('\$Res')}'; } diff --git a/packages/freezed/lib/src/templates/parameter_template.dart b/packages/freezed/lib/src/templates/parameter_template.dart index 9d6a6e00..18d94223 100644 --- a/packages/freezed/lib/src/templates/parameter_template.dart +++ b/packages/freezed/lib/src/templates/parameter_template.dart @@ -82,6 +82,7 @@ class ParametersTemplate { doc: await documentationOfParameter(e, buildStep), isPossiblyDartCollection: e.type.isPossiblyDartCollection, showDefaultValue: true, + parameterElement: e, ); if (isAssignedToThis) return LocalParameter.fromParameter(value); @@ -184,6 +185,7 @@ class Parameter { required this.isFinal, required this.isPossiblyDartCollection, required this.showDefaultValue, + required this.parameterElement, }); Parameter.fromParameter(Parameter p) @@ -201,6 +203,7 @@ class Parameter { showDefaultValue: p.showDefaultValue, doc: p.doc, isPossiblyDartCollection: p.isPossiblyDartCollection, + parameterElement: p.parameterElement, ); final String? type; @@ -216,6 +219,7 @@ class Parameter { final bool isPossiblyDartCollection; final bool isFinal; final String doc; + final ParameterElement? parameterElement; Parameter copyWith({ String? type, @@ -248,6 +252,7 @@ class Parameter { isFinal: isFinal ?? this.isFinal, isPossiblyDartCollection: isPossiblyDartCollection ?? this.isPossiblyDartCollection, + parameterElement: parameterElement, ); @override @@ -283,6 +288,7 @@ class LocalParameter extends Parameter { required List decorators, required String doc, required bool isPossiblyDartCollection, + required ParameterElement? parameterElement, }) : super( name: name, type: type, @@ -297,6 +303,7 @@ class LocalParameter extends Parameter { defaultValueSource: defaultValueSource, doc: doc, isPossiblyDartCollection: isPossiblyDartCollection, + parameterElement: parameterElement, ); LocalParameter.fromParameter(Parameter p) @@ -313,6 +320,7 @@ class LocalParameter extends Parameter { decorators: p.decorators, doc: p.doc, isPossiblyDartCollection: p.isPossiblyDartCollection, + parameterElement: p.parameterElement, ); @override @@ -346,6 +354,7 @@ class CallbackParameter extends Parameter { required this.parameters, required String doc, required bool isPossiblyDartCollection, + required ParameterElement? parameterElement, }) : super( name: name, type: type, @@ -360,6 +369,7 @@ class CallbackParameter extends Parameter { defaultValueSource: defaultValueSource, doc: doc, isPossiblyDartCollection: isPossiblyDartCollection, + parameterElement: parameterElement, ); final ParametersTemplate parameters; diff --git a/packages/freezed/lib/src/templates/properties.dart b/packages/freezed/lib/src/templates/properties.dart index e6155e60..820ea7eb 100644 --- a/packages/freezed/lib/src/templates/properties.dart +++ b/packages/freezed/lib/src/templates/properties.dart @@ -1,6 +1,7 @@ import 'package:analyzer/dart/element/element.dart'; import 'package:analyzer/dart/element/type.dart'; import 'package:build/build.dart'; +import 'package:freezed/src/templates/parameter_template.dart'; import 'package:freezed/src/tools/type.dart'; import 'package:source_gen/source_gen.dart'; @@ -33,7 +34,24 @@ class Property { required this.isPossiblyDartCollection, }) : type = type ?? 'dynamic'; - static Future fromParameter( + Property.fromParameter(Parameter p) + : this( + decorators: p.decorators, + name: p.name, + isFinal: p.isFinal, + doc: p.doc, + type: p.type, + defaultValueSource: p.defaultValueSource, + isNullable: p.isNullable, + isDartList: p.isDartList, + isDartMap: p.isDartMap, + isDartSet: p.isDartSet, + isPossiblyDartCollection: p.isPossiblyDartCollection, + // TODO: support hasJsonKey + hasJsonKey: false, + ); + + static Future fromParameterElement( ParameterElement element, BuildStep buildStep, { required bool addImplicitFinal, @@ -135,6 +153,7 @@ class Property { bool? hasJsonKey, String? doc, bool? isPossiblyDartCollection, + ParameterElement? parameterElement, }) { return Property( type: type ?? this.type, diff --git a/packages/freezed/lib/src/templates/prototypes.dart b/packages/freezed/lib/src/templates/prototypes.dart index b18abccd..c2ebfcc3 100644 --- a/packages/freezed/lib/src/templates/prototypes.dart +++ b/packages/freezed/lib/src/templates/prototypes.dart @@ -127,6 +127,7 @@ String _mapPrototype( // TODO: do we want to support freezed classes that implements MapView/ListView? isPossiblyDartCollection: false, showDefaultValue: false, + parameterElement: null, ), ]); }, @@ -191,6 +192,7 @@ String _unionPrototype( defaultValueSource: '', doc: '', isPossiblyDartCollection: false, + parameterElement: null, ); if (constructor.isDefault) { diff --git a/packages/freezed/pubspec.yaml b/packages/freezed/pubspec.yaml index 50142a04..2b65fa9d 100644 --- a/packages/freezed/pubspec.yaml +++ b/packages/freezed/pubspec.yaml @@ -7,7 +7,7 @@ repository: https://github.com/rrousselGit/freezed issue_tracker: https://github.com/rrousselGit/freezed/issues environment: - sdk: '>=2.17.0 <3.0.0' + sdk: ">=2.17.0 <3.0.0" dependencies: analyzer: ^5.2.0 @@ -26,4 +26,4 @@ dev_dependencies: test: ^1.21.0 matcher: ^0.12.11 source_gen_test: ^1.0.4 - + expect_error: ^1.0.4 diff --git a/packages/freezed/test/common_types_test.dart b/packages/freezed/test/common_types_test.dart new file mode 100644 index 00000000..f99d987b --- /dev/null +++ b/packages/freezed/test/common_types_test.dart @@ -0,0 +1,210 @@ +// ignore_for_file: omit_local_variable_types, unused_local_variable + +import 'package:analyzer/dart/analysis/results.dart'; +import 'package:build_test/build_test.dart'; +import 'package:expect_error/expect_error.dart'; +import 'package:test/test.dart'; + +import 'integration/common_types.dart'; + +Future main() async { + final library = await Library.parseFromStacktrace(); + + test('has no issue', () async { + final main = await resolveSources( + { + 'freezed|test/integration/common_types.dart': useAssetReader, + }, + (r) => r.libraries.firstWhere( + (element) => element.source.toString().contains('common_types')), + ); + + final errorResult = await main.session + .getErrors('/freezed/test/integration/common_types.freezed.dart') + as ErrorsResult; + + expect(errorResult.errors, isEmpty); + }); + + group('CommonSuperSubtype', () { + test('on the shared interface, has the common properties available', () { + const value = CommonSuperSubtype( + nullabilityDifference: 42, + typeDifference: 21, + ); + int? nullabilityDifference = value.nullabilityDifference; + num typeDifference = value.typeDifference; + + expect(value.nullabilityDifference, 42); + expect(value.typeDifference, 21); + + const value2 = CommonSuperSubtype.named( + nullabilityDifference: null, + typeDifference: 22, + ); + expect(value2.nullabilityDifference, null); + expect(value2.typeDifference, 22); + }); + + test('on the subclass, properties use explicit type', () { + const value = CommonSuperSubtype0( + nullabilityDifference: 42, + typeDifference: 21, + ); + int nullabilityDifference = value.nullabilityDifference; + int typeDifference = value.typeDifference; + + expect(value.nullabilityDifference, 42); + expect(value.typeDifference, 21); + + const value2 = CommonSuperSubtype1( + nullabilityDifference: null, + typeDifference: 22, + ); + int? nullabilityDifference2 = value2.nullabilityDifference; + double typeDifference2 = value2.typeDifference; + + expect(value2.nullabilityDifference, null); + expect(value2.typeDifference, 22); + }); + + test( + 'should not have getters for properties that are not shared between all unions', + () async { + await expectLater(library.withCode(''' +import 'integration/common_types.dart'; + +void main() { + const value = CommonSuperSubtype( + nullabilityDifference: 42, + typeDifference: 21, + ); + // expect-error: UNDEFINED_GETTER + value.unknown; +} +'''), compiles); + }); + + test('Can clone properties with nullability difference', () { + const value = CommonSuperSubtype0( + nullabilityDifference: 42, + typeDifference: 21, + ); + + expect( + value.copyWith(nullabilityDifference: 84), + const CommonSuperSubtype0( + nullabilityDifference: 84, + typeDifference: 21, + ), + ); + }); + + test('Cannot clone with type mismatch', () async { + await expectLater(library.withCode(''' +import 'integration/common_types.dart'; + +void main() { + final param = CommonSuperSubtype( + nullabilityDifference: 42, + typeDifference: 21, + ); + param.copyWith( + // Since not all unions have a nullable property, we cannot assign "null" + // on the shared interface. + // expect-error: ARGUMENT_TYPE_NOT_ASSIGNABLE + nullabilityDifference: null, + // Since not all unions use the same type, we can't clone that property at all. + // expect-error: UNDEFINED_NAMED_PARAMETER + typeDifference: 42, + ); +} +'''), compiles); + }); + }); + + group('DeepCopySharedProperties', () { + test('Can clone properties with nullability difference', () { + const value = DeepCopySharedProperties( + CommonSuperSubtype0( + nullabilityDifference: 42, + typeDifference: 21, + ), + ); + + expect( + value.copyWith( + value: const CommonSuperSubtype0( + nullabilityDifference: 84, + typeDifference: 21, + ), + ), + const DeepCopySharedProperties( + CommonSuperSubtype0( + nullabilityDifference: 84, + typeDifference: 21, + ), + ), + ); + + expect( + value.copyWith.value(nullabilityDifference: 84), + const DeepCopySharedProperties( + CommonSuperSubtype0( + nullabilityDifference: 84, + typeDifference: 21, + ), + ), + ); + }); + + test('Cannot clone with type mismatch', () async { + await expectLater(library.withCode(''' +import 'integration/common_types.dart'; + +void main() { + final param = DeepCopySharedProperties( + CommonSuperSubtype( + nullabilityDifference: 42, + typeDifference: 21, + ), + ); + param.copyWith.value( + // Since not all unions have a nullable property, we cannot assign "null" + // on the shared interface. + // expect-error: ARGUMENT_TYPE_NOT_ASSIGNABLE + nullabilityDifference: null, + // Since not all unions use the same type, we can't clone that property at all. + // expect-error: UNDEFINED_NAMED_PARAMETER + typeDifference: 42, + ); +} +'''), compiles); + }); + }); + + group('CommonUnfreezed', () { + test('should have common getters available', () { + final value = CommonUnfreezed.one(a: 42, b: 3.14); + + num a = value.a; + expect(a, 42); + double b = value.b; + expect(b, 3.14); + }); + + test('should not have setters for getters with different type', () async { + await expectLater(library.withCode(''' +import 'integration/common_types.dart'; + +void main() { + final param = CommonUnfreezed.one(a: 42, b: 3.14); + // expect-error: ASSIGNMENT_TO_FINAL_NO_SETTER + param.a = 42.24; + // OK since all union cases are typed the same + param.b = 42; +} +'''), compiles); + }); + }); +} diff --git a/packages/freezed/test/integration/common_types.dart b/packages/freezed/test/integration/common_types.dart new file mode 100644 index 00000000..ef0cc83d --- /dev/null +++ b/packages/freezed/test/integration/common_types.dart @@ -0,0 +1,31 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'common_types.freezed.dart'; + +@freezed +class CommonSuperSubtype with _$CommonSuperSubtype { + const factory CommonSuperSubtype({ + required int nullabilityDifference, + required int typeDifference, + String? unknown, + }) = CommonSuperSubtype0; + + const factory CommonSuperSubtype.named({ + required int? nullabilityDifference, + required double typeDifference, + }) = CommonSuperSubtype1; +} + +@freezed +class DeepCopySharedProperties with _$DeepCopySharedProperties { + const factory DeepCopySharedProperties(CommonSuperSubtype value) = + _DeepCopySharedProperties; +} + +@unfreezed +class CommonUnfreezed with _$CommonUnfreezed { + factory CommonUnfreezed.one({required int a, required double b}) = + CommonUnfreezedOne; + factory CommonUnfreezed.two({required num a, required double b}) = + CommonUnfreezedTwo; +} diff --git a/packages/freezed/test/multiple_constructors_test.dart b/packages/freezed/test/multiple_constructors_test.dart index 6119d7ae..de5f06bb 100644 --- a/packages/freezed/test/multiple_constructors_test.dart +++ b/packages/freezed/test/multiple_constructors_test.dart @@ -504,8 +504,6 @@ void main() { } '''), throwsCompileError); }); - - // TODO: shared property name but different type }); test('Can have a named constructor and a property using the same name', () {