diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..b1f2a0c3 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +**/*.*.dart linguist-generated=true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index daf488d0..0a7755c1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,20 +16,25 @@ jobs: strategy: matrix: package: + - benchmarks/ - packages/freezed - packages/freezed/example - packages/freezed_annotation - packages/freezed_lint + - packages/freezed_lint/example channel: + - master - stable dependencies: - get - downgrade exclude: - - channel: stable + - channel: master dependencies: downgrade - - package: packages/freezed_lint - channel: stable + + defaults: + run: + working-directory: ${{ matrix.package }} steps: - uses: actions/checkout@v5 @@ -37,50 +42,34 @@ jobs: - uses: subosito/flutter-action@v2 with: channel: ${{ matrix.channel }} - cache: ${{ matrix.channel == 'stable' }} - - # It is executed separately - - name: Removing example folder - # Retain example for lint golden test - if: matrix.package != 'packages/freezed_lint' - run: rm -rf example - working-directory: ${{ matrix.package }} + cache: ${{ matrix.channel == 'master' }} - name: Install dependencies - run: | - flutter pub ${{ matrix.dependencies }} - working-directory: ${{ matrix.package }} + run: flutter pub ${{ matrix.dependencies }} - name: Check format # Check dart format only on stable if: matrix.channel == 'stable' run: dart format --set-exit-if-changed . - working-directory: ${{ matrix.package }} - name: Generate - run: | - if grep -q build_runner "pubspec.yaml"; then - dart pub run build_runner build --delete-conflicting-outputs - fi - working-directory: ${{ matrix.package }} + if: matrix.package != 'packages/freezed_lint/example' + continue-on-error: true + run: dart run build_runner build --delete-conflicting-outputs - name: Analyze - run: flutter analyze + run: flutter analyze --fatal-infos working-directory: ${{ matrix.package }} - name: Run tests run: | - if grep -q "name: example" "pubspec.yaml"; then + if grep -q "flutter_test:" "pubspec.yaml"; then flutter test - else + elif grep -q "test:" "pubspec.yaml"; then dart test fi working-directory: ${{ matrix.package }} - name: Lint golden test - if: matrix.package == 'packages/freezed_lint' - run: | - dart pub get - dart analyze - dart run custom_lint - working-directory: 'packages/freezed_lint/example' + if: matrix.package == 'packages/freezed_lint/example' + run: dart run custom_lint --fatal-infos diff --git a/.gitignore b/.gitignore index b4db8079..84af905e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ +.dart_tool .idea/ *.iml build/ node_modules -/package-lock.json \ No newline at end of file +/package-lock.json diff --git a/benchmarks/.gitignore b/benchmarks/.gitignore index 220a573b..637a17cb 100644 --- a/benchmarks/.gitignore +++ b/benchmarks/.gitignore @@ -1,6 +1,3 @@ -/.dart_tool /test/**/*.g.dart /test/**/*.freezed.dart .packages -# Remove the following pattern if you wish to check in your lock file -pubspec.lock \ No newline at end of file diff --git a/benchmarks/lib/src/copy_with.dart b/benchmarks/lib/src/copy_with.dart index 2684bdf1..34c2e69c 100644 --- a/benchmarks/lib/src/copy_with.dart +++ b/benchmarks/lib/src/copy_with.dart @@ -11,9 +11,7 @@ abstract class Model with _$Model { @freezed abstract class ModelWrapper with _$ModelWrapper { - factory ModelWrapper({ - required Model model, - }) = _ModelWrapper; + factory ModelWrapper({required Model model}) = _ModelWrapper; } void main(List arguments) { diff --git a/benchmarks/lib/src/copy_with.freezed.dart b/benchmarks/lib/src/copy_with.freezed.dart index d39b5892..9f3bbc6b 100644 --- a/benchmarks/lib/src/copy_with.freezed.dart +++ b/benchmarks/lib/src/copy_with.freezed.dart @@ -1,6 +1,5 @@ -// dart format width=80 -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // 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, unnecessary_question_mark diff --git a/benchmarks/lib/src/equal.freezed.dart b/benchmarks/lib/src/equal.freezed.dart index 4205236b..29c84df8 100644 --- a/benchmarks/lib/src/equal.freezed.dart +++ b/benchmarks/lib/src/equal.freezed.dart @@ -1,6 +1,5 @@ -// dart format width=80 -// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file // 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, unnecessary_question_mark diff --git a/benchmarks/pubspec.yaml b/benchmarks/pubspec.yaml index ca1220ad..1ad764e7 100644 --- a/benchmarks/pubspec.yaml +++ b/benchmarks/pubspec.yaml @@ -1,27 +1,19 @@ -name: example +name: freezed_benchmarks description: A new Flutter project. publish_to: none environment: sdk: ^3.5.0 +resolution: workspace + dependencies: flutter: sdk: flutter - freezed_annotation: - path: ../packages/freezed_annotation - json_annotation: ^4.4.0 + freezed_annotation: ^3.0.0 + json_annotation: ^4.9.0 dev_dependencies: - freezed: - path: ../packages/freezed + freezed: ^3.0.2 json_serializable: ^6.1.3 build_runner: - flutter_test: - sdk: flutter - -dependency_overrides: - freezed: - path: ../packages/freezed - freezed_annotation: - path: ../packages/freezed_annotation diff --git a/packages/freezed/.gitignore b/packages/freezed/.gitignore index 220a573b..637a17cb 100644 --- a/packages/freezed/.gitignore +++ b/packages/freezed/.gitignore @@ -1,6 +1,3 @@ -/.dart_tool /test/**/*.g.dart /test/**/*.freezed.dart .packages -# Remove the following pattern if you wish to check in your lock file -pubspec.lock \ No newline at end of file diff --git a/packages/freezed/build.yaml b/packages/freezed/build.yaml index f31ada05..b78bf662 100644 --- a/packages/freezed/build.yaml +++ b/packages/freezed/build.yaml @@ -1,11 +1,14 @@ targets: $default: + sources: + exclude: + - example/* + builders: freezed: enabled: true generate_for: exclude: - - example - test/source_gen_src.dart include: - test/* diff --git a/packages/freezed/example/.gitignore b/packages/freezed/example/.gitignore index 91ca32d6..ae1f1838 100644 --- a/packages/freezed/example/.gitignore +++ b/packages/freezed/example/.gitignore @@ -1,6 +1,3 @@ -*.freezed.dart -*.g.dart - # Miscellaneous *.class *.log diff --git a/packages/freezed/example/lib/diagnosticable.freezed.dart b/packages/freezed/example/lib/diagnosticable.freezed.dart new file mode 100644 index 00000000..0de3a043 --- /dev/null +++ b/packages/freezed/example/lib/diagnosticable.freezed.dart @@ -0,0 +1,325 @@ +// dart format width=80 +// 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, unnecessary_question_mark + +part of 'diagnosticable.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; +/// @nodoc +mixin _$Example implements DiagnosticableTreeMixin { + + dynamic get theAnswer; + + +@override +void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'Example<$T>')) + ..add(DiagnosticsProperty('theAnswer', theAnswer)); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Example&&const DeepCollectionEquality().equals(other.theAnswer, theAnswer)); +} + + +@override +int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(theAnswer)); + +@override +String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) { + return 'Example<$T>(theAnswer: $theAnswer)'; +} + + +} + +/// @nodoc +class $ExampleCopyWith { +$ExampleCopyWith(Example _, $Res Function(Example) __); +} + + +/// @nodoc + + +class _Example extends Example with DiagnosticableTreeMixin { + _Example(this.a, this.b): super._(); + + + final int a; + final String b; + +/// Create a copy of Example +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ExampleCopyWith> get copyWith => __$ExampleCopyWithImpl>(this, _$identity); + + +@override +void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'Example<$T>')) + ..add(DiagnosticsProperty('a', a))..add(DiagnosticsProperty('b', b)); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Example&&(identical(other.a, a) || other.a == a)&&(identical(other.b, b) || other.b == b)); +} + + +@override +int get hashCode => Object.hash(runtimeType,a,b); + +@override +String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) { + return 'Example<$T>(a: $a, b: $b)'; +} + + +} + +/// @nodoc +abstract mixin class _$ExampleCopyWith implements $ExampleCopyWith { + factory _$ExampleCopyWith(_Example value, $Res Function(_Example) _then) = __$ExampleCopyWithImpl; +@useResult +$Res call({ + int a, String b +}); + + + + +} +/// @nodoc +class __$ExampleCopyWithImpl + implements _$ExampleCopyWith { + __$ExampleCopyWithImpl(this._self, this._then); + + final _Example _self; + final $Res Function(_Example) _then; + +/// Create a copy of Example +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? a = null,Object? b = null,}) { + return _then(_Example( +null == a ? _self.a : a // ignore: cast_nullable_to_non_nullable +as int,null == b ? _self.b : b // ignore: cast_nullable_to_non_nullable +as String, + )); +} + + +} + +/// @nodoc + + +class _Example2 extends Example with DiagnosticableTreeMixin { + _Example2(this.c): super._(); + + + final T c; + +/// Create a copy of Example +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$Example2CopyWith> get copyWith => __$Example2CopyWithImpl>(this, _$identity); + + +@override +void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'Example<$T>.named')) + ..add(DiagnosticsProperty('c', c)); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Example2&&const DeepCollectionEquality().equals(other.c, c)); +} + + +@override +int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(c)); + +@override +String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) { + return 'Example<$T>.named(c: $c)'; +} + + +} + +/// @nodoc +abstract mixin class _$Example2CopyWith implements $ExampleCopyWith { + factory _$Example2CopyWith(_Example2 value, $Res Function(_Example2) _then) = __$Example2CopyWithImpl; +@useResult +$Res call({ + T c +}); + + + + +} +/// @nodoc +class __$Example2CopyWithImpl + implements _$Example2CopyWith { + __$Example2CopyWithImpl(this._self, this._then); + + final _Example2 _self; + final $Res Function(_Example2) _then; + +/// Create a copy of Example +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? c = freezed,}) { + return _then(_Example2( +freezed == c ? _self.c : c // ignore: cast_nullable_to_non_nullable +as T, + )); +} + + +} + +/// @nodoc +mixin _$ConcreteExample implements DiagnosticableTreeMixin { + + + + +@override +void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'ConcreteExample<$T>')) + ; +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ConcreteExample); +} + + +@override +int get hashCode => runtimeType.hashCode; + +@override +String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) { + return 'ConcreteExample<$T>()'; +} + + +} + +/// @nodoc +class $ConcreteExampleCopyWith { +$ConcreteExampleCopyWith(ConcreteExample _, $Res Function(ConcreteExample) __); +} + + +/// @nodoc + + +class _ConcreteExample extends ConcreteExample with DiagnosticableTreeMixin { + _ConcreteExample(): super._(); + + + + + + +@override +void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'ConcreteExample<$T>')) + ; +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConcreteExample); +} + + +@override +int get hashCode => runtimeType.hashCode; + +@override +String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) { + return 'ConcreteExample<$T>()'; +} + + +} + + + + +/// @nodoc +mixin _$ToString { + + + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ToString); +} + + +@override +int get hashCode => runtimeType.hashCode; + + + +} + +/// @nodoc +class $ToStringCopyWith<$Res> { +$ToStringCopyWith(ToString _, $Res Function(ToString) __); +} + + +/// @nodoc + + +class _ToString extends ToString { + _ToString(): super._(); + + + + + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ToString); +} + + +@override +int get hashCode => runtimeType.hashCode; + + + +} + + + + +// dart format on diff --git a/packages/freezed/example/lib/equals.freezed.dart b/packages/freezed/example/lib/equals.freezed.dart new file mode 100644 index 00000000..fcf38e32 --- /dev/null +++ b/packages/freezed/example/lib/equals.freezed.dart @@ -0,0 +1,131 @@ +// dart format width=80 +// 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, unnecessary_question_mark + +part of 'equals.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; +/// @nodoc +mixin _$Equals { + + String? get name; int? get age; +/// Create a copy of Equals +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$EqualsCopyWith get copyWith => _$EqualsCopyWithImpl(this as Equals, _$identity); + + + + + +@override +String toString() { + return 'Equals(name: $name, age: $age)'; +} + + +} + +/// @nodoc +abstract mixin class $EqualsCopyWith<$Res> { + factory $EqualsCopyWith(Equals value, $Res Function(Equals) _then) = _$EqualsCopyWithImpl; +@useResult +$Res call({ + String? name, int? age +}); + + + + +} +/// @nodoc +class _$EqualsCopyWithImpl<$Res> + implements $EqualsCopyWith<$Res> { + _$EqualsCopyWithImpl(this._self, this._then); + + final Equals _self; + final $Res Function(Equals) _then; + +/// Create a copy of Equals +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? name = freezed,Object? age = freezed,}) { + return _then(_self.copyWith( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,age: freezed == age ? _self.age : age // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +} + + +/// @nodoc + + +class _Equals extends Equals { + _Equals({this.name, this.age}): super._(); + + +@override final String? name; +@override final int? age; + +/// Create a copy of Equals +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$EqualsCopyWith<_Equals> get copyWith => __$EqualsCopyWithImpl<_Equals>(this, _$identity); + + + + + +@override +String toString() { + return 'Equals(name: $name, age: $age)'; +} + + +} + +/// @nodoc +abstract mixin class _$EqualsCopyWith<$Res> implements $EqualsCopyWith<$Res> { + factory _$EqualsCopyWith(_Equals value, $Res Function(_Equals) _then) = __$EqualsCopyWithImpl; +@override @useResult +$Res call({ + String? name, int? age +}); + + + + +} +/// @nodoc +class __$EqualsCopyWithImpl<$Res> + implements _$EqualsCopyWith<$Res> { + __$EqualsCopyWithImpl(this._self, this._then); + + final _Equals _self; + final $Res Function(_Equals) _then; + +/// Create a copy of Equals +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = freezed,Object? age = freezed,}) { + return _then(_Equals( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,age: freezed == age ? _self.age : age // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + + +} + +// dart format on diff --git a/packages/freezed/example/lib/main.freezed.dart b/packages/freezed/example/lib/main.freezed.dart new file mode 100644 index 00000000..c882e239 --- /dev/null +++ b/packages/freezed/example/lib/main.freezed.dart @@ -0,0 +1,726 @@ +// dart format width=80 +// 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, unnecessary_question_mark + +part of 'main.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; +/// @nodoc +mixin _$MyClass implements DiagnosticableTreeMixin { + + String? get a; int? get b; +/// Create a copy of MyClass +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$MyClassCopyWith get copyWith => _$MyClassCopyWithImpl(this as MyClass, _$identity); + + +@override +void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'MyClass')) + ..add(DiagnosticsProperty('a', a))..add(DiagnosticsProperty('b', b)); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is MyClass&&(identical(other.a, a) || other.a == a)&&(identical(other.b, b) || other.b == b)); +} + + +@override +int get hashCode => Object.hash(runtimeType,a,b); + +@override +String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) { + return 'MyClass(a: $a, b: $b)'; +} + + +} + +/// @nodoc +abstract mixin class $MyClassCopyWith<$Res> { + factory $MyClassCopyWith(MyClass value, $Res Function(MyClass) _then) = _$MyClassCopyWithImpl; +@useResult +$Res call({ + String? a, int? b +}); + + + + +} +/// @nodoc +class _$MyClassCopyWithImpl<$Res> + implements $MyClassCopyWith<$Res> { + _$MyClassCopyWithImpl(this._self, this._then); + + final MyClass _self; + final $Res Function(MyClass) _then; + +/// Create a copy of MyClass +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? a = freezed,Object? b = freezed,}) { + return _then(_self.copyWith( +a: freezed == a ? _self.a : a // ignore: cast_nullable_to_non_nullable +as String?,b: freezed == b ? _self.b : b // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +} + + +/// @nodoc + + +class _MyClass with DiagnosticableTreeMixin implements MyClass { + _MyClass({this.a, this.b}); + + +@override final String? a; +@override final int? b; + +/// Create a copy of MyClass +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$MyClassCopyWith<_MyClass> get copyWith => __$MyClassCopyWithImpl<_MyClass>(this, _$identity); + + +@override +void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'MyClass')) + ..add(DiagnosticsProperty('a', a))..add(DiagnosticsProperty('b', b)); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _MyClass&&(identical(other.a, a) || other.a == a)&&(identical(other.b, b) || other.b == b)); +} + + +@override +int get hashCode => Object.hash(runtimeType,a,b); + +@override +String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) { + return 'MyClass(a: $a, b: $b)'; +} + + +} + +/// @nodoc +abstract mixin class _$MyClassCopyWith<$Res> implements $MyClassCopyWith<$Res> { + factory _$MyClassCopyWith(_MyClass value, $Res Function(_MyClass) _then) = __$MyClassCopyWithImpl; +@override @useResult +$Res call({ + String? a, int? b +}); + + + + +} +/// @nodoc +class __$MyClassCopyWithImpl<$Res> + implements _$MyClassCopyWith<$Res> { + __$MyClassCopyWithImpl(this._self, this._then); + + final _MyClass _self; + final $Res Function(_MyClass) _then; + +/// Create a copy of MyClass +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? a = freezed,Object? b = freezed,}) { + return _then(_MyClass( +a: freezed == a ? _self.a : a // ignore: cast_nullable_to_non_nullable +as String?,b: freezed == b ? _self.b : b // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + + +} + +Union _$UnionFromJson( + Map json +) { + switch (json['custom-key']) { + case 'Default': + return Data.fromJson( + json + ); + case 'Loading': + return Loading.fromJson( + json + ); + case 'Error': + return ErrorDetails.fromJson( + json + ); + case 'Complex': + return Complex.fromJson( + json + ); + + default: + throw CheckedFromJsonException( + json, + 'custom-key', + 'Union', + 'Invalid union type "${json['custom-key']}"!' +); + } + +} + +/// @nodoc +mixin _$Union implements DiagnosticableTreeMixin { + + + + /// Serializes this Union to a JSON map. + Map toJson(); + +@override +void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'Union')) + ; +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Union); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => runtimeType.hashCode; + +@override +String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) { + return 'Union()'; +} + + +} + +/// @nodoc +class $UnionCopyWith<$Res> { +$UnionCopyWith(Union _, $Res Function(Union) __); +} + + +/// @nodoc +@JsonSerializable() + +class Data with DiagnosticableTreeMixin implements Union { + const Data(this.value, {final String? $type}): $type = $type ?? 'Default'; + factory Data.fromJson(Map json) => _$DataFromJson(json); + + final int value; + +@JsonKey(name: 'custom-key') +final String $type; + + +/// Create a copy of Union +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$DataCopyWith get copyWith => _$DataCopyWithImpl(this, _$identity); + +@override +Map toJson() { + return _$DataToJson(this, ); +} +@override +void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'Union')) + ..add(DiagnosticsProperty('value', value)); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Data&&(identical(other.value, value) || other.value == value)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,value); + +@override +String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) { + return 'Union(value: $value)'; +} + + +} + +/// @nodoc +abstract mixin class $DataCopyWith<$Res> implements $UnionCopyWith<$Res> { + factory $DataCopyWith(Data value, $Res Function(Data) _then) = _$DataCopyWithImpl; +@useResult +$Res call({ + int value +}); + + + + +} +/// @nodoc +class _$DataCopyWithImpl<$Res> + implements $DataCopyWith<$Res> { + _$DataCopyWithImpl(this._self, this._then); + + final Data _self; + final $Res Function(Data) _then; + +/// Create a copy of Union +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? value = null,}) { + return _then(Data( +null == value ? _self.value : value // ignore: cast_nullable_to_non_nullable +as int, + )); +} + + +} + +/// @nodoc +@JsonSerializable() + +class Loading with DiagnosticableTreeMixin implements Union { + const Loading({final String? $type}): $type = $type ?? 'Loading'; + factory Loading.fromJson(Map json) => _$LoadingFromJson(json); + + + +@JsonKey(name: 'custom-key') +final String $type; + + + +@override +Map toJson() { + return _$LoadingToJson(this, ); +} +@override +void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'Union.loading')) + ; +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Loading); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => runtimeType.hashCode; + +@override +String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) { + return 'Union.loading()'; +} + + +} + + + + +/// @nodoc +@JsonSerializable() + +class ErrorDetails with DiagnosticableTreeMixin implements Union { + const ErrorDetails([this.message, final String? $type]): $type = $type ?? 'Error'; + factory ErrorDetails.fromJson(Map json) => _$ErrorDetailsFromJson(json); + + final String? message; + +@JsonKey(name: 'custom-key') +final String $type; + + +/// Create a copy of Union +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ErrorDetailsCopyWith get copyWith => _$ErrorDetailsCopyWithImpl(this, _$identity); + +@override +Map toJson() { + return _$ErrorDetailsToJson(this, ); +} +@override +void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'Union.error')) + ..add(DiagnosticsProperty('message', message)); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ErrorDetails&&(identical(other.message, message) || other.message == message)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,message); + +@override +String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) { + return 'Union.error(message: $message)'; +} + + +} + +/// @nodoc +abstract mixin class $ErrorDetailsCopyWith<$Res> implements $UnionCopyWith<$Res> { + factory $ErrorDetailsCopyWith(ErrorDetails value, $Res Function(ErrorDetails) _then) = _$ErrorDetailsCopyWithImpl; +@useResult +$Res call({ + String? message +}); + + + + +} +/// @nodoc +class _$ErrorDetailsCopyWithImpl<$Res> + implements $ErrorDetailsCopyWith<$Res> { + _$ErrorDetailsCopyWithImpl(this._self, this._then); + + final ErrorDetails _self; + final $Res Function(ErrorDetails) _then; + +/// Create a copy of Union +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? message = freezed,}) { + return _then(ErrorDetails( +freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +/// @nodoc +@JsonSerializable() + +class Complex with DiagnosticableTreeMixin implements Union { + const Complex(this.a, this.b, {final String? $type}): $type = $type ?? 'Complex'; + factory Complex.fromJson(Map json) => _$ComplexFromJson(json); + + final int a; + final String b; + +@JsonKey(name: 'custom-key') +final String $type; + + +/// Create a copy of Union +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ComplexCopyWith get copyWith => _$ComplexCopyWithImpl(this, _$identity); + +@override +Map toJson() { + return _$ComplexToJson(this, ); +} +@override +void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'Union.complex')) + ..add(DiagnosticsProperty('a', a))..add(DiagnosticsProperty('b', b)); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Complex&&(identical(other.a, a) || other.a == a)&&(identical(other.b, b) || other.b == b)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,a,b); + +@override +String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) { + return 'Union.complex(a: $a, b: $b)'; +} + + +} + +/// @nodoc +abstract mixin class $ComplexCopyWith<$Res> implements $UnionCopyWith<$Res> { + factory $ComplexCopyWith(Complex value, $Res Function(Complex) _then) = _$ComplexCopyWithImpl; +@useResult +$Res call({ + int a, String b +}); + + + + +} +/// @nodoc +class _$ComplexCopyWithImpl<$Res> + implements $ComplexCopyWith<$Res> { + _$ComplexCopyWithImpl(this._self, this._then); + + final Complex _self; + final $Res Function(Complex) _then; + +/// Create a copy of Union +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? a = null,Object? b = null,}) { + return _then(Complex( +null == a ? _self.a : a // ignore: cast_nullable_to_non_nullable +as int,null == b ? _self.b : b // ignore: cast_nullable_to_non_nullable +as String, + )); +} + + +} + +/// @nodoc +mixin _$SharedProperty implements DiagnosticableTreeMixin { + + String? get name; +/// Create a copy of SharedProperty +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SharedPropertyCopyWith get copyWith => _$SharedPropertyCopyWithImpl(this as SharedProperty, _$identity); + + +@override +void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'SharedProperty')) + ..add(DiagnosticsProperty('name', name)); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SharedProperty&&(identical(other.name, name) || other.name == name)); +} + + +@override +int get hashCode => Object.hash(runtimeType,name); + +@override +String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) { + return 'SharedProperty(name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class $SharedPropertyCopyWith<$Res> { + factory $SharedPropertyCopyWith(SharedProperty value, $Res Function(SharedProperty) _then) = _$SharedPropertyCopyWithImpl; +@useResult +$Res call({ + String? name +}); + + + + +} +/// @nodoc +class _$SharedPropertyCopyWithImpl<$Res> + implements $SharedPropertyCopyWith<$Res> { + _$SharedPropertyCopyWithImpl(this._self, this._then); + + final SharedProperty _self; + final $Res Function(SharedProperty) _then; + +/// Create a copy of SharedProperty +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? name = freezed,}) { + return _then(_self.copyWith( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// @nodoc + + +class SharedProperty0 with DiagnosticableTreeMixin implements SharedProperty { + SharedProperty0({this.name, this.age}); + + +@override final String? name; + final int? age; + +/// Create a copy of SharedProperty +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SharedProperty0CopyWith get copyWith => _$SharedProperty0CopyWithImpl(this, _$identity); + + +@override +void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'SharedProperty.person')) + ..add(DiagnosticsProperty('name', name))..add(DiagnosticsProperty('age', age)); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SharedProperty0&&(identical(other.name, name) || other.name == name)&&(identical(other.age, age) || other.age == age)); +} + + +@override +int get hashCode => Object.hash(runtimeType,name,age); + +@override +String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) { + return 'SharedProperty.person(name: $name, age: $age)'; +} + + +} + +/// @nodoc +abstract mixin class $SharedProperty0CopyWith<$Res> implements $SharedPropertyCopyWith<$Res> { + factory $SharedProperty0CopyWith(SharedProperty0 value, $Res Function(SharedProperty0) _then) = _$SharedProperty0CopyWithImpl; +@override @useResult +$Res call({ + String? name, int? age +}); + + + + +} +/// @nodoc +class _$SharedProperty0CopyWithImpl<$Res> + implements $SharedProperty0CopyWith<$Res> { + _$SharedProperty0CopyWithImpl(this._self, this._then); + + final SharedProperty0 _self; + final $Res Function(SharedProperty0) _then; + +/// Create a copy of SharedProperty +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = freezed,Object? age = freezed,}) { + return _then(SharedProperty0( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,age: freezed == age ? _self.age : age // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + + +} + +/// @nodoc + + +class SharedProperty1 with DiagnosticableTreeMixin implements SharedProperty { + SharedProperty1({this.name, this.population}); + + +@override final String? name; + final int? population; + +/// Create a copy of SharedProperty +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SharedProperty1CopyWith get copyWith => _$SharedProperty1CopyWithImpl(this, _$identity); + + +@override +void debugFillProperties(DiagnosticPropertiesBuilder properties) { + properties + ..add(DiagnosticsProperty('type', 'SharedProperty.city')) + ..add(DiagnosticsProperty('name', name))..add(DiagnosticsProperty('population', population)); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SharedProperty1&&(identical(other.name, name) || other.name == name)&&(identical(other.population, population) || other.population == population)); +} + + +@override +int get hashCode => Object.hash(runtimeType,name,population); + +@override +String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) { + return 'SharedProperty.city(name: $name, population: $population)'; +} + + +} + +/// @nodoc +abstract mixin class $SharedProperty1CopyWith<$Res> implements $SharedPropertyCopyWith<$Res> { + factory $SharedProperty1CopyWith(SharedProperty1 value, $Res Function(SharedProperty1) _then) = _$SharedProperty1CopyWithImpl; +@override @useResult +$Res call({ + String? name, int? population +}); + + + + +} +/// @nodoc +class _$SharedProperty1CopyWithImpl<$Res> + implements $SharedProperty1CopyWith<$Res> { + _$SharedProperty1CopyWithImpl(this._self, this._then); + + final SharedProperty1 _self; + final $Res Function(SharedProperty1) _then; + +/// Create a copy of SharedProperty +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = freezed,Object? population = freezed,}) { + return _then(SharedProperty1( +name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,population: freezed == population ? _self.population : population // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + + +} + +// dart format on diff --git a/packages/freezed/example/lib/main.g.dart b/packages/freezed/example/lib/main.g.dart new file mode 100644 index 00000000..6ece3c69 --- /dev/null +++ b/packages/freezed/example/lib/main.g.dart @@ -0,0 +1,45 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: type=lint + +part of 'main.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Data _$DataFromJson(Map json) => + Data((json['value'] as num).toInt(), $type: json['custom-key'] as String?); + +Map _$DataToJson(Data instance) => { + 'value': instance.value, + 'custom-key': instance.$type, +}; + +Loading _$LoadingFromJson(Map json) => + Loading($type: json['custom-key'] as String?); + +Map _$LoadingToJson(Loading instance) => { + 'custom-key': instance.$type, +}; + +ErrorDetails _$ErrorDetailsFromJson(Map json) => + ErrorDetails(json['message'] as String?, json['custom-key'] as String?); + +Map _$ErrorDetailsToJson(ErrorDetails instance) => + { + 'message': instance.message, + 'custom-key': instance.$type, + }; + +Complex _$ComplexFromJson(Map json) => Complex( + (json['a'] as num).toInt(), + json['b'] as String, + $type: json['custom-key'] as String?, +); + +Map _$ComplexToJson(Complex instance) => { + 'a': instance.a, + 'b': instance.b, + 'custom-key': instance.$type, +}; diff --git a/packages/freezed/example/lib/non_diagnosticable.freezed.dart b/packages/freezed/example/lib/non_diagnosticable.freezed.dart new file mode 100644 index 00000000..385843df --- /dev/null +++ b/packages/freezed/example/lib/non_diagnosticable.freezed.dart @@ -0,0 +1,1036 @@ +// dart format width=80 +// 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, unnecessary_question_mark + +part of 'non_diagnosticable.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; +/// @nodoc +mixin _$Example { + + + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is Example); +} + + +@override +int get hashCode => runtimeType.hashCode; + +@override +String toString() { + return 'Example<$T>()'; +} + + +} + +/// @nodoc +class $ExampleCopyWith { +$ExampleCopyWith(Example _, $Res Function(Example) __); +} + + +/// @nodoc + + +class _Example implements Example { + _Example(this.a, this.b); + + + final int a; + final String b; + +/// Create a copy of Example +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ExampleCopyWith> get copyWith => __$ExampleCopyWithImpl>(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Example&&(identical(other.a, a) || other.a == a)&&(identical(other.b, b) || other.b == b)); +} + + +@override +int get hashCode => Object.hash(runtimeType,a,b); + +@override +String toString() { + return 'Example<$T>(a: $a, b: $b)'; +} + + +} + +/// @nodoc +abstract mixin class _$ExampleCopyWith implements $ExampleCopyWith { + factory _$ExampleCopyWith(_Example value, $Res Function(_Example) _then) = __$ExampleCopyWithImpl; +@useResult +$Res call({ + int a, String b +}); + + + + +} +/// @nodoc +class __$ExampleCopyWithImpl + implements _$ExampleCopyWith { + __$ExampleCopyWithImpl(this._self, this._then); + + final _Example _self; + final $Res Function(_Example) _then; + +/// Create a copy of Example +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? a = null,Object? b = null,}) { + return _then(_Example( +null == a ? _self.a : a // ignore: cast_nullable_to_non_nullable +as int,null == b ? _self.b : b // ignore: cast_nullable_to_non_nullable +as String, + )); +} + + +} + +/// @nodoc + + +class _Example2 implements Example { + _Example2(this.c); + + + final T c; + +/// Create a copy of Example +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$Example2CopyWith> get copyWith => __$Example2CopyWithImpl>(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Example2&&const DeepCollectionEquality().equals(other.c, c)); +} + + +@override +int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(c)); + +@override +String toString() { + return 'Example<$T>.named(c: $c)'; +} + + +} + +/// @nodoc +abstract mixin class _$Example2CopyWith implements $ExampleCopyWith { + factory _$Example2CopyWith(_Example2 value, $Res Function(_Example2) _then) = __$Example2CopyWithImpl; +@useResult +$Res call({ + T c +}); + + + + +} +/// @nodoc +class __$Example2CopyWithImpl + implements _$Example2CopyWith { + __$Example2CopyWithImpl(this._self, this._then); + + final _Example2 _self; + final $Res Function(_Example2) _then; + +/// Create a copy of Example +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? c = freezed,}) { + return _then(_Example2( +freezed == c ? _self.c : c // ignore: cast_nullable_to_non_nullable +as T, + )); +} + + +} + +/// @nodoc +mixin _$SimpleImplements { + + String get name; +/// Create a copy of SimpleImplements +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SimpleImplementsCopyWith get copyWith => _$SimpleImplementsCopyWithImpl(this as SimpleImplements, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SimpleImplements&&(identical(other.name, name) || other.name == name)); +} + + +@override +int get hashCode => Object.hash(runtimeType,name); + +@override +String toString() { + return 'SimpleImplements(name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class $SimpleImplementsCopyWith<$Res> { + factory $SimpleImplementsCopyWith(SimpleImplements value, $Res Function(SimpleImplements) _then) = _$SimpleImplementsCopyWithImpl; +@useResult +$Res call({ + String name +}); + + + + +} +/// @nodoc +class _$SimpleImplementsCopyWithImpl<$Res> + implements $SimpleImplementsCopyWith<$Res> { + _$SimpleImplementsCopyWithImpl(this._self, this._then); + + final SimpleImplements _self; + final $Res Function(SimpleImplements) _then; + +/// Create a copy of SimpleImplements +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? name = null,}) { + return _then(_self.copyWith( +name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String, + )); +} + +} + + +/// @nodoc + + +class SimplePerson implements SimpleImplements { + const SimplePerson(this.name, this.age); + + +@override final String name; + final int age; + +/// Create a copy of SimpleImplements +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SimplePersonCopyWith get copyWith => _$SimplePersonCopyWithImpl(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SimplePerson&&(identical(other.name, name) || other.name == name)&&(identical(other.age, age) || other.age == age)); +} + + +@override +int get hashCode => Object.hash(runtimeType,name,age); + +@override +String toString() { + return 'SimpleImplements.person(name: $name, age: $age)'; +} + + +} + +/// @nodoc +abstract mixin class $SimplePersonCopyWith<$Res> implements $SimpleImplementsCopyWith<$Res> { + factory $SimplePersonCopyWith(SimplePerson value, $Res Function(SimplePerson) _then) = _$SimplePersonCopyWithImpl; +@override @useResult +$Res call({ + String name, int age +}); + + + + +} +/// @nodoc +class _$SimplePersonCopyWithImpl<$Res> + implements $SimplePersonCopyWith<$Res> { + _$SimplePersonCopyWithImpl(this._self, this._then); + + final SimplePerson _self; + final $Res Function(SimplePerson) _then; + +/// Create a copy of SimpleImplements +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = null,Object? age = null,}) { + return _then(SimplePerson( +null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,null == age ? _self.age : age // ignore: cast_nullable_to_non_nullable +as int, + )); +} + + +} + +/// @nodoc + + +class SimpleStreet with AdministrativeArea implements SimpleImplements { + const SimpleStreet(this.name); + + +@override final String name; + +/// Create a copy of SimpleImplements +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SimpleStreetCopyWith get copyWith => _$SimpleStreetCopyWithImpl(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SimpleStreet&&(identical(other.name, name) || other.name == name)); +} + + +@override +int get hashCode => Object.hash(runtimeType,name); + +@override +String toString() { + return 'SimpleImplements.street(name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class $SimpleStreetCopyWith<$Res> implements $SimpleImplementsCopyWith<$Res> { + factory $SimpleStreetCopyWith(SimpleStreet value, $Res Function(SimpleStreet) _then) = _$SimpleStreetCopyWithImpl; +@override @useResult +$Res call({ + String name +}); + + + + +} +/// @nodoc +class _$SimpleStreetCopyWithImpl<$Res> + implements $SimpleStreetCopyWith<$Res> { + _$SimpleStreetCopyWithImpl(this._self, this._then); + + final SimpleStreet _self; + final $Res Function(SimpleStreet) _then; + +/// Create a copy of SimpleImplements +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = null,}) { + return _then(SimpleStreet( +null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String, + )); +} + + +} + +/// @nodoc + + +class SimpleCity with House implements SimpleImplements { + const SimpleCity(this.name, this.population); + + +@override final String name; + final int population; + +/// Create a copy of SimpleImplements +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SimpleCityCopyWith get copyWith => _$SimpleCityCopyWithImpl(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SimpleCity&&(identical(other.name, name) || other.name == name)&&(identical(other.population, population) || other.population == population)); +} + + +@override +int get hashCode => Object.hash(runtimeType,name,population); + +@override +String toString() { + return 'SimpleImplements.city(name: $name, population: $population)'; +} + + +} + +/// @nodoc +abstract mixin class $SimpleCityCopyWith<$Res> implements $SimpleImplementsCopyWith<$Res> { + factory $SimpleCityCopyWith(SimpleCity value, $Res Function(SimpleCity) _then) = _$SimpleCityCopyWithImpl; +@override @useResult +$Res call({ + String name, int population +}); + + + + +} +/// @nodoc +class _$SimpleCityCopyWithImpl<$Res> + implements $SimpleCityCopyWith<$Res> { + _$SimpleCityCopyWithImpl(this._self, this._then); + + final SimpleCity _self; + final $Res Function(SimpleCity) _then; + +/// Create a copy of SimpleImplements +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = null,Object? population = null,}) { + return _then(SimpleCity( +null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,null == population ? _self.population : population // ignore: cast_nullable_to_non_nullable +as int, + )); +} + + +} + +/// @nodoc + + +class SimpleCountry with House implements SimpleImplements, GeographicArea { + const SimpleCountry(this.name, this.population); + + +@override final String name; + final int population; + +/// Create a copy of SimpleImplements +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$SimpleCountryCopyWith get copyWith => _$SimpleCountryCopyWithImpl(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is SimpleCountry&&(identical(other.name, name) || other.name == name)&&(identical(other.population, population) || other.population == population)); +} + + +@override +int get hashCode => Object.hash(runtimeType,name,population); + +@override +String toString() { + return 'SimpleImplements.country(name: $name, population: $population)'; +} + + +} + +/// @nodoc +abstract mixin class $SimpleCountryCopyWith<$Res> implements $SimpleImplementsCopyWith<$Res> { + factory $SimpleCountryCopyWith(SimpleCountry value, $Res Function(SimpleCountry) _then) = _$SimpleCountryCopyWithImpl; +@override @useResult +$Res call({ + String name, int population +}); + + + + +} +/// @nodoc +class _$SimpleCountryCopyWithImpl<$Res> + implements $SimpleCountryCopyWith<$Res> { + _$SimpleCountryCopyWithImpl(this._self, this._then); + + final SimpleCountry _self; + final $Res Function(SimpleCountry) _then; + +/// Create a copy of SimpleImplements +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = null,Object? population = null,}) { + return _then(SimpleCountry( +null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,null == population ? _self.population : population // ignore: cast_nullable_to_non_nullable +as int, + )); +} + + +} + +/// @nodoc +mixin _$CustomMethodImplements { + + String get name; +/// Create a copy of CustomMethodImplements +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CustomMethodImplementsCopyWith get copyWith => _$CustomMethodImplementsCopyWithImpl(this as CustomMethodImplements, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CustomMethodImplements&&(identical(other.name, name) || other.name == name)); +} + + +@override +int get hashCode => Object.hash(runtimeType,name); + +@override +String toString() { + return 'CustomMethodImplements(name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class $CustomMethodImplementsCopyWith<$Res> { + factory $CustomMethodImplementsCopyWith(CustomMethodImplements value, $Res Function(CustomMethodImplements) _then) = _$CustomMethodImplementsCopyWithImpl; +@useResult +$Res call({ + String name +}); + + + + +} +/// @nodoc +class _$CustomMethodImplementsCopyWithImpl<$Res> + implements $CustomMethodImplementsCopyWith<$Res> { + _$CustomMethodImplementsCopyWithImpl(this._self, this._then); + + final CustomMethodImplements _self; + final $Res Function(CustomMethodImplements) _then; + +/// Create a copy of CustomMethodImplements +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? name = null,}) { + return _then(_self.copyWith( +name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String, + )); +} + +} + + +/// @nodoc + + +class PersonCustomMethod extends CustomMethodImplements { + const PersonCustomMethod(this.name, this.age): super._(); + + +@override final String name; + final int age; + +/// Create a copy of CustomMethodImplements +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$PersonCustomMethodCopyWith get copyWith => _$PersonCustomMethodCopyWithImpl(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is PersonCustomMethod&&(identical(other.name, name) || other.name == name)&&(identical(other.age, age) || other.age == age)); +} + + +@override +int get hashCode => Object.hash(runtimeType,name,age); + +@override +String toString() { + return 'CustomMethodImplements.person(name: $name, age: $age)'; +} + + +} + +/// @nodoc +abstract mixin class $PersonCustomMethodCopyWith<$Res> implements $CustomMethodImplementsCopyWith<$Res> { + factory $PersonCustomMethodCopyWith(PersonCustomMethod value, $Res Function(PersonCustomMethod) _then) = _$PersonCustomMethodCopyWithImpl; +@override @useResult +$Res call({ + String name, int age +}); + + + + +} +/// @nodoc +class _$PersonCustomMethodCopyWithImpl<$Res> + implements $PersonCustomMethodCopyWith<$Res> { + _$PersonCustomMethodCopyWithImpl(this._self, this._then); + + final PersonCustomMethod _self; + final $Res Function(PersonCustomMethod) _then; + +/// Create a copy of CustomMethodImplements +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = null,Object? age = null,}) { + return _then(PersonCustomMethod( +null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,null == age ? _self.age : age // ignore: cast_nullable_to_non_nullable +as int, + )); +} + + +} + +/// @nodoc + + +class StreetCustomMethod extends CustomMethodImplements with Shop, AdministrativeArea { + const StreetCustomMethod(this.name): super._(); + + +@override final String name; + +/// Create a copy of CustomMethodImplements +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$StreetCustomMethodCopyWith get copyWith => _$StreetCustomMethodCopyWithImpl(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is StreetCustomMethod&&(identical(other.name, name) || other.name == name)); +} + + +@override +int get hashCode => Object.hash(runtimeType,name); + +@override +String toString() { + return 'CustomMethodImplements.street(name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class $StreetCustomMethodCopyWith<$Res> implements $CustomMethodImplementsCopyWith<$Res> { + factory $StreetCustomMethodCopyWith(StreetCustomMethod value, $Res Function(StreetCustomMethod) _then) = _$StreetCustomMethodCopyWithImpl; +@override @useResult +$Res call({ + String name +}); + + + + +} +/// @nodoc +class _$StreetCustomMethodCopyWithImpl<$Res> + implements $StreetCustomMethodCopyWith<$Res> { + _$StreetCustomMethodCopyWithImpl(this._self, this._then); + + final StreetCustomMethod _self; + final $Res Function(StreetCustomMethod) _then; + +/// Create a copy of CustomMethodImplements +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = null,}) { + return _then(StreetCustomMethod( +null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String, + )); +} + + +} + +/// @nodoc + + +class CityCustomMethod extends CustomMethodImplements with House implements GeographicArea { + const CityCustomMethod(this.name, this.population): super._(); + + +@override final String name; + final int population; + +/// Create a copy of CustomMethodImplements +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CityCustomMethodCopyWith get copyWith => _$CityCustomMethodCopyWithImpl(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CityCustomMethod&&(identical(other.name, name) || other.name == name)&&(identical(other.population, population) || other.population == population)); +} + + +@override +int get hashCode => Object.hash(runtimeType,name,population); + +@override +String toString() { + return 'CustomMethodImplements.city(name: $name, population: $population)'; +} + + +} + +/// @nodoc +abstract mixin class $CityCustomMethodCopyWith<$Res> implements $CustomMethodImplementsCopyWith<$Res> { + factory $CityCustomMethodCopyWith(CityCustomMethod value, $Res Function(CityCustomMethod) _then) = _$CityCustomMethodCopyWithImpl; +@override @useResult +$Res call({ + String name, int population +}); + + + + +} +/// @nodoc +class _$CityCustomMethodCopyWithImpl<$Res> + implements $CityCustomMethodCopyWith<$Res> { + _$CityCustomMethodCopyWithImpl(this._self, this._then); + + final CityCustomMethod _self; + final $Res Function(CityCustomMethod) _then; + +/// Create a copy of CustomMethodImplements +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = null,Object? population = null,}) { + return _then(CityCustomMethod( +null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,null == population ? _self.population : population // ignore: cast_nullable_to_non_nullable +as int, + )); +} + + +} + +/// @nodoc + + +class DuplexCustomMethod extends CustomMethodImplements implements Shop, GeographicArea { + const DuplexCustomMethod(this.name): super._(); + + +@override final String name; + +/// Create a copy of CustomMethodImplements +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$DuplexCustomMethodCopyWith get copyWith => _$DuplexCustomMethodCopyWithImpl(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is DuplexCustomMethod&&(identical(other.name, name) || other.name == name)); +} + + +@override +int get hashCode => Object.hash(runtimeType,name); + +@override +String toString() { + return 'CustomMethodImplements.duplex(name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class $DuplexCustomMethodCopyWith<$Res> implements $CustomMethodImplementsCopyWith<$Res> { + factory $DuplexCustomMethodCopyWith(DuplexCustomMethod value, $Res Function(DuplexCustomMethod) _then) = _$DuplexCustomMethodCopyWithImpl; +@override @useResult +$Res call({ + String name +}); + + + + +} +/// @nodoc +class _$DuplexCustomMethodCopyWithImpl<$Res> + implements $DuplexCustomMethodCopyWith<$Res> { + _$DuplexCustomMethodCopyWithImpl(this._self, this._then); + + final DuplexCustomMethod _self; + final $Res Function(DuplexCustomMethod) _then; + +/// Create a copy of CustomMethodImplements +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = null,}) { + return _then(DuplexCustomMethod( +null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String, + )); +} + + +} + +/// @nodoc +mixin _$GenericImplements { + + String get name; +/// Create a copy of GenericImplements +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$GenericImplementsCopyWith> get copyWith => _$GenericImplementsCopyWithImpl>(this as GenericImplements, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is GenericImplements&&(identical(other.name, name) || other.name == name)); +} + + +@override +int get hashCode => Object.hash(runtimeType,name); + +@override +String toString() { + return 'GenericImplements<$T>(name: $name)'; +} + + +} + +/// @nodoc +abstract mixin class $GenericImplementsCopyWith { + factory $GenericImplementsCopyWith(GenericImplements value, $Res Function(GenericImplements) _then) = _$GenericImplementsCopyWithImpl; +@useResult +$Res call({ + String name +}); + + + + +} +/// @nodoc +class _$GenericImplementsCopyWithImpl + implements $GenericImplementsCopyWith { + _$GenericImplementsCopyWithImpl(this._self, this._then); + + final GenericImplements _self; + final $Res Function(GenericImplements) _then; + +/// Create a copy of GenericImplements +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? name = null,}) { + return _then(_self.copyWith( +name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String, + )); +} + +} + + +/// @nodoc + + +class GenericPerson implements GenericImplements { + const GenericPerson(this.name, this.age); + + +@override final String name; + final int age; + +/// Create a copy of GenericImplements +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$GenericPersonCopyWith> get copyWith => _$GenericPersonCopyWithImpl>(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is GenericPerson&&(identical(other.name, name) || other.name == name)&&(identical(other.age, age) || other.age == age)); +} + + +@override +int get hashCode => Object.hash(runtimeType,name,age); + +@override +String toString() { + return 'GenericImplements<$T>.person(name: $name, age: $age)'; +} + + +} + +/// @nodoc +abstract mixin class $GenericPersonCopyWith implements $GenericImplementsCopyWith { + factory $GenericPersonCopyWith(GenericPerson value, $Res Function(GenericPerson) _then) = _$GenericPersonCopyWithImpl; +@override @useResult +$Res call({ + String name, int age +}); + + + + +} +/// @nodoc +class _$GenericPersonCopyWithImpl + implements $GenericPersonCopyWith { + _$GenericPersonCopyWithImpl(this._self, this._then); + + final GenericPerson _self; + final $Res Function(GenericPerson) _then; + +/// Create a copy of GenericImplements +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = null,Object? age = null,}) { + return _then(GenericPerson( +null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,null == age ? _self.age : age // ignore: cast_nullable_to_non_nullable +as int, + )); +} + + +} + +/// @nodoc + + +class GenericCity with House implements GenericImplements, GeographicArea { + const GenericCity(this.name, this.population); + + +@override final String name; + final int population; + +/// Create a copy of GenericImplements +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$GenericCityCopyWith> get copyWith => _$GenericCityCopyWithImpl>(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is GenericCity&&(identical(other.name, name) || other.name == name)&&(identical(other.population, population) || other.population == population)); +} + + +@override +int get hashCode => Object.hash(runtimeType,name,population); + +@override +String toString() { + return 'GenericImplements<$T>.city(name: $name, population: $population)'; +} + + +} + +/// @nodoc +abstract mixin class $GenericCityCopyWith implements $GenericImplementsCopyWith { + factory $GenericCityCopyWith(GenericCity value, $Res Function(GenericCity) _then) = _$GenericCityCopyWithImpl; +@override @useResult +$Res call({ + String name, int population +}); + + + + +} +/// @nodoc +class _$GenericCityCopyWithImpl + implements $GenericCityCopyWith { + _$GenericCityCopyWithImpl(this._self, this._then); + + final GenericCity _self; + final $Res Function(GenericCity) _then; + +/// Create a copy of GenericImplements +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = null,Object? population = null,}) { + return _then(GenericCity( +null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,null == population ? _self.population : population // ignore: cast_nullable_to_non_nullable +as int, + )); +} + + +} + +// dart format on diff --git a/packages/freezed/example/lib/time_slot.freezed.dart b/packages/freezed/example/lib/time_slot.freezed.dart new file mode 100644 index 00000000..c88dcd27 --- /dev/null +++ b/packages/freezed/example/lib/time_slot.freezed.dart @@ -0,0 +1,145 @@ +// dart format width=80 +// 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, unnecessary_question_mark + +part of 'time_slot.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; +/// @nodoc +mixin _$TimeSlot { + + TimeOfDay? get start; TimeOfDay? get end; +/// Create a copy of TimeSlot +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$TimeSlotCopyWith get copyWith => _$TimeSlotCopyWithImpl(this as TimeSlot, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is TimeSlot&&(identical(other.start, start) || other.start == start)&&(identical(other.end, end) || other.end == end)); +} + + +@override +int get hashCode => Object.hash(runtimeType,start,end); + +@override +String toString() { + return 'TimeSlot(start: $start, end: $end)'; +} + + +} + +/// @nodoc +abstract mixin class $TimeSlotCopyWith<$Res> { + factory $TimeSlotCopyWith(TimeSlot value, $Res Function(TimeSlot) _then) = _$TimeSlotCopyWithImpl; +@useResult +$Res call({ + TimeOfDay? start, TimeOfDay? end +}); + + + + +} +/// @nodoc +class _$TimeSlotCopyWithImpl<$Res> + implements $TimeSlotCopyWith<$Res> { + _$TimeSlotCopyWithImpl(this._self, this._then); + + final TimeSlot _self; + final $Res Function(TimeSlot) _then; + +/// Create a copy of TimeSlot +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? start = freezed,Object? end = freezed,}) { + return _then(_self.copyWith( +start: freezed == start ? _self.start : start // ignore: cast_nullable_to_non_nullable +as TimeOfDay?,end: freezed == end ? _self.end : end // ignore: cast_nullable_to_non_nullable +as TimeOfDay?, + )); +} + +} + + +/// @nodoc + + +class _TimeSlot implements TimeSlot { + _TimeSlot({this.start, this.end}); + + +@override final TimeOfDay? start; +@override final TimeOfDay? end; + +/// Create a copy of TimeSlot +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$TimeSlotCopyWith<_TimeSlot> get copyWith => __$TimeSlotCopyWithImpl<_TimeSlot>(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _TimeSlot&&(identical(other.start, start) || other.start == start)&&(identical(other.end, end) || other.end == end)); +} + + +@override +int get hashCode => Object.hash(runtimeType,start,end); + +@override +String toString() { + return 'TimeSlot(start: $start, end: $end)'; +} + + +} + +/// @nodoc +abstract mixin class _$TimeSlotCopyWith<$Res> implements $TimeSlotCopyWith<$Res> { + factory _$TimeSlotCopyWith(_TimeSlot value, $Res Function(_TimeSlot) _then) = __$TimeSlotCopyWithImpl; +@override @useResult +$Res call({ + TimeOfDay? start, TimeOfDay? end +}); + + + + +} +/// @nodoc +class __$TimeSlotCopyWithImpl<$Res> + implements _$TimeSlotCopyWith<$Res> { + __$TimeSlotCopyWithImpl(this._self, this._then); + + final _TimeSlot _self; + final $Res Function(_TimeSlot) _then; + +/// Create a copy of TimeSlot +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? start = freezed,Object? end = freezed,}) { + return _then(_TimeSlot( +start: freezed == start ? _self.start : start // ignore: cast_nullable_to_non_nullable +as TimeOfDay?,end: freezed == end ? _self.end : end // ignore: cast_nullable_to_non_nullable +as TimeOfDay?, + )); +} + + +} + +// dart format on diff --git a/packages/freezed/example/pubspec.yaml b/packages/freezed/example/pubspec.yaml index 4d1d3f83..1d6e1345 100644 --- a/packages/freezed/example/pubspec.yaml +++ b/packages/freezed/example/pubspec.yaml @@ -3,25 +3,18 @@ description: A new Flutter project. publish_to: none environment: - sdk: ">=3.6.0 <4.0.0" + sdk: ">=3.7.0 <4.0.0" +resolution: workspace dependencies: flutter: sdk: flutter - freezed_annotation: - path: ../../freezed_annotation + freezed_annotation: ^3.0.0 json_annotation: ^4.9.0 dev_dependencies: - freezed: - path: ../ + freezed: ^3.0.2 json_serializable: ^6.9.4 build_runner: flutter_test: sdk: flutter - -dependency_overrides: - freezed: - path: ../ - freezed_annotation: - path: ../../freezed_annotation diff --git a/packages/freezed/pubspec.yaml b/packages/freezed/pubspec.yaml index 54d3ed14..00660497 100644 --- a/packages/freezed/pubspec.yaml +++ b/packages/freezed/pubspec.yaml @@ -8,6 +8,7 @@ issue_tracker: https://github.com/rrousselGit/freezed/issues environment: sdk: ">=3.8.0 <4.0.0" +resolution: workspace dependencies: analyzer: ^8.0.0 @@ -15,10 +16,10 @@ dependencies: build_config: ^1.1.0 collection: ^1.15.0 meta: ^1.9.1 - source_gen: ^4.0.0 + source_gen: ^3.1.0 freezed_annotation: 3.1.0 - json_annotation: ^4.8.0 - dart_style: ^3.0.0 + json_annotation: ^4.9.0 + dart_style: ^3.1.0 pub_semver: ^2.2.0 dev_dependencies: diff --git a/packages/freezed_annotation/.gitignore b/packages/freezed_annotation/.gitignore index 220a573b..637a17cb 100644 --- a/packages/freezed_annotation/.gitignore +++ b/packages/freezed_annotation/.gitignore @@ -1,6 +1,3 @@ -/.dart_tool /test/**/*.g.dart /test/**/*.freezed.dart .packages -# Remove the following pattern if you wish to check in your lock file -pubspec.lock \ No newline at end of file diff --git a/packages/freezed_annotation/pubspec.yaml b/packages/freezed_annotation/pubspec.yaml index 945c965e..d93ba737 100644 --- a/packages/freezed_annotation/pubspec.yaml +++ b/packages/freezed_annotation/pubspec.yaml @@ -7,11 +7,12 @@ repository: https://github.com/rrousselGit/freezed issue_tracker: https://github.com/rrousselGit/freezed/issues environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ">=3.5.0 <4.0.0" +resolution: workspace dependencies: collection: ^1.15.0 - json_annotation: ^4.8.0 + json_annotation: ^4.9.0 meta: ^1.7.0 dev_dependencies: diff --git a/packages/freezed_annotation/pubspec_overrides.yaml b/packages/freezed_annotation/pubspec_overrides.yaml deleted file mode 100644 index 0e3d234a..00000000 --- a/packages/freezed_annotation/pubspec_overrides.yaml +++ /dev/null @@ -1,15 +0,0 @@ -dependency_overrides: - # pub downgrade: - # build_runner 2.2.0 => glob 2.0.0 => file 6.0.0 - # freezed requires file: ^6.1.3 - file: ^6.1.3 - # build_runner 2.3.3 => code_builder 4.2.0 => matcher 0.12.11 - # freezed requires matcher: ^0.12.14 - matcher: ^0.12.14 - # build_runner 2.3.3 => pub_semver 2.0.0 - # freezed requires pub_semver: ^2.1.3 - pub_semver: ^2.1.3 - # watcher 1.0.0 extends, implements, or mixens sealed class 'FileSystemEvent' - watcher: ^1.1.0 - # https://github.com/dart-lang/build/issues/3733#issuecomment-2272082820 - frontend_server_client: ^4.0.0 diff --git a/packages/freezed_lint/.gitignore b/packages/freezed_lint/.gitignore index 8ecd45da..2f8179aa 100644 --- a/packages/freezed_lint/.gitignore +++ b/packages/freezed_lint/.gitignore @@ -1,5 +1,2 @@ -/.dart_tool .packages -# Remove the following pattern if you wish to check in your lock file -pubspec.lock -custom_lint.log \ No newline at end of file +custom_lint.log diff --git a/packages/freezed_lint/example/analysis_options.yaml b/packages/freezed_lint/example/analysis_options.yaml index 1c31e2ac..16458d64 100644 --- a/packages/freezed_lint/example/analysis_options.yaml +++ b/packages/freezed_lint/example/analysis_options.yaml @@ -7,5 +7,11 @@ analyzer: strict-raw-types: true errors: invalid_annotation_target: ignore + + # Expected errors + uri_does_not_exist: ignore + redirect_to_non_class: ignore + mixin_of_non_class: ignore + unused_element: ignore plugins: - - custom_lint \ No newline at end of file + - custom_lint diff --git a/packages/freezed_lint/example/lib/missing_mixin.freezed.dart b/packages/freezed_lint/example/lib/missing_mixin.freezed.dart deleted file mode 100644 index 4e5f531f..00000000 --- a/packages/freezed_lint/example/lib/missing_mixin.freezed.dart +++ /dev/null @@ -1,404 +0,0 @@ -// 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, unnecessary_question_mark - -part of 'missing_mixin.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -/// @nodoc -mixin _$MissingMixin {} - -/// @nodoc -abstract class $MissingMixinCopyWith<$Res> { - factory $MissingMixinCopyWith( - MissingMixin value, $Res Function(MissingMixin) then) = - _$MissingMixinCopyWithImpl<$Res, MissingMixin>; -} - -/// @nodoc -class _$MissingMixinCopyWithImpl<$Res, $Val extends MissingMixin> - implements $MissingMixinCopyWith<$Res> { - _$MissingMixinCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of MissingMixin - /// with the given fields replaced by the non-null parameter values. -} - -/// @nodoc -abstract class _$$MissingMixinImplCopyWith<$Res> { - factory _$$MissingMixinImplCopyWith( - _$MissingMixinImpl value, $Res Function(_$MissingMixinImpl) then) = - __$$MissingMixinImplCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$MissingMixinImplCopyWithImpl<$Res> - extends _$MissingMixinCopyWithImpl<$Res, _$MissingMixinImpl> - implements _$$MissingMixinImplCopyWith<$Res> { - __$$MissingMixinImplCopyWithImpl( - _$MissingMixinImpl _value, $Res Function(_$MissingMixinImpl) _then) - : super(_value, _then); - - /// Create a copy of MissingMixin - /// with the given fields replaced by the non-null parameter values. -} - -/// @nodoc - -class _$MissingMixinImpl implements _MissingMixin { - const _$MissingMixinImpl(); - - @override - String toString() { - return 'MissingMixin()'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$MissingMixinImpl); - } - - @override - int get hashCode => runtimeType.hashCode; -} - -abstract class _MissingMixin implements MissingMixin { - const factory _MissingMixin() = _$MissingMixinImpl; -} - -/// @nodoc -mixin _$WithMixin {} - -/// @nodoc -abstract class $WithMixinCopyWith<$Res> { - factory $WithMixinCopyWith(WithMixin value, $Res Function(WithMixin) then) = - _$WithMixinCopyWithImpl<$Res, WithMixin>; -} - -/// @nodoc -class _$WithMixinCopyWithImpl<$Res, $Val extends WithMixin> - implements $WithMixinCopyWith<$Res> { - _$WithMixinCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of WithMixin - /// with the given fields replaced by the non-null parameter values. -} - -/// @nodoc -abstract class _$$WithMixinImplCopyWith<$Res> { - factory _$$WithMixinImplCopyWith( - _$WithMixinImpl value, $Res Function(_$WithMixinImpl) then) = - __$$WithMixinImplCopyWithImpl<$Res>; -} - -/// @nodoc -class __$$WithMixinImplCopyWithImpl<$Res> - extends _$WithMixinCopyWithImpl<$Res, _$WithMixinImpl> - implements _$$WithMixinImplCopyWith<$Res> { - __$$WithMixinImplCopyWithImpl( - _$WithMixinImpl _value, $Res Function(_$WithMixinImpl) _then) - : super(_value, _then); - - /// Create a copy of WithMixin - /// with the given fields replaced by the non-null parameter values. -} - -/// @nodoc - -class _$WithMixinImpl implements _WithMixin { - const _$WithMixinImpl(); - - @override - String toString() { - return 'WithMixin()'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && other is _$WithMixinImpl); - } - - @override - int get hashCode => runtimeType.hashCode; -} - -abstract class _WithMixin implements WithMixin { - const factory _WithMixin() = _$WithMixinImpl; -} - -/// @nodoc -mixin _$FooModel { - int get id => throw _privateConstructorUsedError; - - /// Create a copy of FooModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $FooModelCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $FooModelCopyWith<$Res> { - factory $FooModelCopyWith(FooModel value, $Res Function(FooModel) then) = - _$FooModelCopyWithImpl<$Res, FooModel>; - @useResult - $Res call({int id}); -} - -/// @nodoc -class _$FooModelCopyWithImpl<$Res, $Val extends FooModel> - implements $FooModelCopyWith<$Res> { - _$FooModelCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of FooModel - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$FooModelImplCopyWith<$Res> - implements $FooModelCopyWith<$Res> { - factory _$$FooModelImplCopyWith( - _$FooModelImpl value, $Res Function(_$FooModelImpl) then) = - __$$FooModelImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({int id}); -} - -/// @nodoc -class __$$FooModelImplCopyWithImpl<$Res> - extends _$FooModelCopyWithImpl<$Res, _$FooModelImpl> - implements _$$FooModelImplCopyWith<$Res> { - __$$FooModelImplCopyWithImpl( - _$FooModelImpl _value, $Res Function(_$FooModelImpl) _then) - : super(_value, _then); - - /// Create a copy of FooModel - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - }) { - return _then(_$FooModelImpl( - null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - )); - } -} - -/// @nodoc - -class _$FooModelImpl extends _FooModel { - const _$FooModelImpl(this.id) : super._(); - - @override - final int id; - - @override - String toString() { - return 'FooModel(id: $id)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$FooModelImpl && - (identical(other.id, id) || other.id == id)); - } - - @override - int get hashCode => Object.hash(runtimeType, id); - - /// Create a copy of FooModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$FooModelImplCopyWith<_$FooModelImpl> get copyWith => - __$$FooModelImplCopyWithImpl<_$FooModelImpl>(this, _$identity); -} - -abstract class _FooModel extends FooModel { - const factory _FooModel(final int id) = _$FooModelImpl; - const _FooModel._() : super._(); - - @override - int get id; - - /// Create a copy of FooModel - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$FooModelImplCopyWith<_$FooModelImpl> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -mixin _$BarModel { - int get id => throw _privateConstructorUsedError; - - /// Create a copy of BarModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $BarModelCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $BarModelCopyWith<$Res> { - factory $BarModelCopyWith(BarModel value, $Res Function(BarModel) then) = - _$BarModelCopyWithImpl<$Res, BarModel>; - @useResult - $Res call({int id}); -} - -/// @nodoc -class _$BarModelCopyWithImpl<$Res, $Val extends BarModel> - implements $BarModelCopyWith<$Res> { - _$BarModelCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of BarModel - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$BarModelImplCopyWith<$Res> - implements $BarModelCopyWith<$Res> { - factory _$$BarModelImplCopyWith( - _$BarModelImpl value, $Res Function(_$BarModelImpl) then) = - __$$BarModelImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({int id}); -} - -/// @nodoc -class __$$BarModelImplCopyWithImpl<$Res> - extends _$BarModelCopyWithImpl<$Res, _$BarModelImpl> - implements _$$BarModelImplCopyWith<$Res> { - __$$BarModelImplCopyWithImpl( - _$BarModelImpl _value, $Res Function(_$BarModelImpl) _then) - : super(_value, _then); - - /// Create a copy of BarModel - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? id = null, - }) { - return _then(_$BarModelImpl( - null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - )); - } -} - -/// @nodoc - -class _$BarModelImpl extends _BarModel { - const _$BarModelImpl(this.id) : super._(); - - @override - final int id; - - @override - String toString() { - return 'BarModel(id: $id)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$BarModelImpl && - (identical(other.id, id) || other.id == id)); - } - - @override - int get hashCode => Object.hash(runtimeType, id); - - /// Create a copy of BarModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$BarModelImplCopyWith<_$BarModelImpl> get copyWith => - __$$BarModelImplCopyWithImpl<_$BarModelImpl>(this, _$identity); -} - -abstract class _BarModel extends BarModel { - const factory _BarModel(final int id) = _$BarModelImpl; - const _BarModel._() : super._(); - - @override - int get id; - - /// Create a copy of BarModel - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$BarModelImplCopyWith<_$BarModelImpl> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/packages/freezed_lint/example/pubspec.yaml b/packages/freezed_lint/example/pubspec.yaml index 5379bf58..c27e7991 100644 --- a/packages/freezed_lint/example/pubspec.yaml +++ b/packages/freezed_lint/example/pubspec.yaml @@ -1,7 +1,8 @@ # The pubspec.yaml of an application using our lints -name: example_app +name: lint_example environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ">=3.7.0 <4.0.0" +resolution: workspace publish_to: none dependencies: @@ -12,7 +13,3 @@ dev_dependencies: custom_lint: any freezed: any freezed_lint: any - -dependency_overrides: - freezed_lint: - path: ../ diff --git a/packages/freezed_lint/lib/src/missing_mixin.dart b/packages/freezed_lint/lib/src/missing_mixin.dart index c7165cdb..70165c40 100644 --- a/packages/freezed_lint/lib/src/missing_mixin.dart +++ b/packages/freezed_lint/lib/src/missing_mixin.dart @@ -8,7 +8,7 @@ class MissingMixin extends DartLintRule { static const _code = LintCode( name: 'freezed_missing_mixin', - problemMessage: 'Freezed class should mixin with {0}', + problemMessage: 'Freezed class should mixin {0}', ); @override diff --git a/packages/freezed_lint/lib/src/missing_private_empty_ctor.dart b/packages/freezed_lint/lib/src/missing_private_empty_ctor.dart index fc8db5c4..6f3efab4 100644 --- a/packages/freezed_lint/lib/src/missing_private_empty_ctor.dart +++ b/packages/freezed_lint/lib/src/missing_private_empty_ctor.dart @@ -12,8 +12,8 @@ class MissingPrivateEmptyCtor extends DartLintRule { name: 'freezed_missing_private_empty_constructor', problemMessage: 'Private empty constructor required', correctionMessage: - 'Freezed classes containing methods, fields or accessors,' - 'requires a {0}', + 'Freezed classes containing methods, fields or accessors, ' + 'require a {0}', errorSeverity: DiagnosticSeverity.ERROR, ); diff --git a/packages/freezed_lint/pubspec.yaml b/packages/freezed_lint/pubspec.yaml index 67303a1e..5aec8660 100644 --- a/packages/freezed_lint/pubspec.yaml +++ b/packages/freezed_lint/pubspec.yaml @@ -6,13 +6,14 @@ repository: https://github.com/rrousselGit/freezed issue_tracker: https://github.com/rrousselGit/freezed/issues environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ">=3.5.0 <4.0.0" +resolution: workspace dependencies: analyzer: ^8.0.0 - analyzer_plugin: ^0.13.0 + analyzer_plugin: ^0.13.4 custom_lint_builder: ^0.8.1 - freezed_annotation: 3.1.0 + freezed_annotation: ^3.1.0 dev_dependencies: custom_lint: ^0.8.1 diff --git a/packages/freezed_lint/pubspec_overrides.yaml b/packages/freezed_lint/pubspec_overrides.yaml deleted file mode 100644 index b055cd3e..00000000 --- a/packages/freezed_lint/pubspec_overrides.yaml +++ /dev/null @@ -1,3 +0,0 @@ -dependency_overrides: - freezed_annotation: - path: ../freezed_annotation diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 00000000..a972d32b --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,765 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: da0d9209ca76bde579f2da330aeb9df62b6319c834fa7baae052021b0462401f + url: "https://pub.dev" + source: hosted + version: "85.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: f4ad0fea5f102201015c9aae9d93bc02f75dd9491529a8c21f88d17a8523d44c + url: "https://pub.dev" + source: hosted + version: "7.6.0" + analyzer_plugin: + dependency: transitive + description: + name: analyzer_plugin + sha256: a5ab7590c27b779f3d4de67f31c4109dbe13dd7339f86461a6f2a8ab2594d8ce + url: "https://pub.dev" + source: hosted + version: "0.13.4" + args: + dependency: transitive + description: + name: args + sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 + url: "https://pub.dev" + source: hosted + version: "2.6.0" + async: + dependency: transitive + description: + name: async + sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + url: "https://pub.dev" + source: hosted + version: "2.12.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + build: + dependency: transitive + description: + name: build + sha256: "7d95cbbb1526ab5ae977df9b4cc660963b9b27f6d1075c0b34653868911385e4" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + build_config: + dependency: transitive + description: + name: build_config + sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "8e928697a82be082206edb0b9c99c5a4ad6bc31c9e9b8b2f291ae65cd4a25daa" + url: "https://pub.dev" + source: hosted + version: "4.0.4" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: "38c9c339333a09b090a638849a4c56e70a404c6bdd3b511493addfbc113b60c2" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + build_runner: + dependency: transitive + description: + name: build_runner + sha256: b971d4a1c789eba7be3e6fe6ce5e5b50fd3719e3cb485b3fad6d04358304351d + url: "https://pub.dev" + source: hosted + version: "2.6.0" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: c04e612ca801cd0928ccdb891c263a2b1391cb27940a5ea5afcf9ba894de5d62 + url: "https://pub.dev" + source: hosted + version: "9.2.0" + build_test: + dependency: transitive + description: + name: build_test + sha256: "090115dcc4a30c2e1dc0fdefbaa57d0d8d0237c964636bd7ba6928cfde9bf92f" + url: "https://pub.dev" + source: hosted + version: "3.3.0" + build_verify: + dependency: transitive + description: + name: build_verify + sha256: abbb9b9eda076854ac1678d284c053a5ec608e64da741d0801f56d4bbea27e23 + url: "https://pub.dev" + source: hosted + version: "3.1.0" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: ba95c961bafcd8686d1cf63be864eb59447e795e124d98d6a27d91fcd13602fb + url: "https://pub.dev" + source: hosted + version: "8.11.1" + characters: + dependency: transitive + description: + name: characters + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + ci: + dependency: transitive + description: + name: ci + sha256: "145d095ce05cddac4d797a158bc4cf3b6016d1fe63d8c3d2fbd7212590adca13" + url: "https://pub.dev" + source: hosted + version: "0.1.0" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c + url: "https://pub.dev" + source: hosted + version: "0.4.2" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" + url: "https://pub.dev" + source: hosted + version: "4.10.1" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + coverage: + dependency: transitive + description: + name: coverage + sha256: e3493833ea012784c740e341952298f1cc77f1f01b1bbc3eb4eecf6984fb7f43 + url: "https://pub.dev" + source: hosted + version: "1.11.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + csslib: + dependency: transitive + description: + name: csslib + sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + custom_lint: + dependency: transitive + description: + name: custom_lint + sha256: "78085fbe842de7c5bef92de811ca81536968dbcbbcdac5c316711add2d15e796" + url: "https://pub.dev" + source: hosted + version: "0.8.0" + custom_lint_builder: + dependency: transitive + description: + name: custom_lint_builder + sha256: cc5532d5733d4eccfccaaec6070a1926e9f21e613d93ad0927fad020b95c9e52 + url: "https://pub.dev" + source: hosted + version: "0.8.0" + custom_lint_core: + dependency: transitive + description: + name: custom_lint_core + sha256: cc4684d22ca05bf0a4a51127e19a8aea576b42079ed2bc9e956f11aaebe35dd1 + url: "https://pub.dev" + source: hosted + version: "0.8.0" + custom_lint_visitor: + dependency: transitive + description: + name: custom_lint_visitor + sha256: "4a86a0d8415a91fbb8298d6ef03e9034dc8e323a599ddc4120a0e36c433983a2" + url: "https://pub.dev" + source: hosted + version: "1.0.0+7.7.0" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "8a0e5fba27e8ee025d2ffb4ee820b4e6e2cf5e4246a6b1a477eb66866947e0bb" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + expect_error: + dependency: transitive + description: + name: expect_error + sha256: "6dd706b2074b64505f2802d022f6ce0d313c450207b275e57e116bcb08369114" + url: "https://pub.dev" + source: hosted + version: "1.0.10" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + url: "https://pub.dev" + source: hosted + version: "1.3.3" + file: + dependency: "direct overridden" + description: + name: file + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" + source: hosted + version: "6.1.4" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + flutter_test: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + frontend_server_client: + dependency: "direct overridden" + description: + name: frontend_server_client + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.dev" + source: hosted + version: "2.1.3" + graphs: + dependency: transitive + description: + name: graphs + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + hotreloader: + dependency: transitive + description: + name: hotreloader + sha256: bc167a1163807b03bada490bfe2df25b0d744df359227880220a5cbd04e5734b + url: "https://pub.dev" + source: hosted + version: "4.3.0" + html: + dependency: transitive + description: + name: html + sha256: "1fc58edeaec4307368c60d59b7e15b9d658b57d7f3125098b6294153c75337ec" + url: "https://pub.dev" + source: hosted + version: "0.15.5" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 + url: "https://pub.dev" + source: hosted + version: "3.2.2" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + io: + dependency: transitive + description: + name: io + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b + url: "https://pub.dev" + source: hosted + version: "1.0.5" + js: + dependency: transitive + description: + name: js + sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc" + url: "https://pub.dev" + source: hosted + version: "0.7.2" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + json_serializable: + dependency: transitive + description: + name: json_serializable + sha256: "3f2913b7c2430afe8ac5afe6fb15c1de4a60af4f630625e6e238f80ba4b80cbd" + url: "https://pub.dev" + source: hosted + version: "6.11.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "8dcda04c3fc16c14f48a7bb586d4be1f0d1572731b6d81d51772ef47c02081e0" + url: "https://pub.dev" + source: hosted + version: "11.0.1" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" + url: "https://pub.dev" + source: hosted + version: "3.0.10" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + matcher: + dependency: "direct overridden" + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.dev" + source: hosted + version: "0.12.17" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + url: "https://pub.dev" + source: hosted + version: "1.16.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + node_preamble: + dependency: transitive + description: + name: node_preamble + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + package_config: + dependency: transitive + description: + name: package_config + sha256: "92d4488434b520a62570293fbd33bb556c7d49230791c1b4bbd973baf6d2dc67" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + pub_semver: + dependency: "direct overridden" + description: + name: pub_semver + sha256: "7b3cfbf654f3edd0c6298ecd5be782ce997ddf0e00531b9464b55245185bbbbd" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" + url: "https://pub.dev" + source: hosted + version: "1.5.0" + quiver: + dependency: "direct overridden" + description: + name: quiver + sha256: ea0b925899e64ecdfbf9c7becb60d5b50e706ade44a85b2363be2a22d88117d2 + url: "https://pub.dev" + source: hosted + version: "3.2.2" + rxdart: + dependency: transitive + description: + name: rxdart + sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" + url: "https://pub.dev" + source: hosted + version: "0.28.0" + shelf: + dependency: transitive + description: + name: shelf + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 + url: "https://pub.dev" + source: hosted + version: "1.4.2" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + shelf_static: + dependency: transitive + description: + name: shelf_static + sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3 + url: "https://pub.dev" + source: hosted + version: "1.1.3" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: "7b19d6ba131c6eb98bfcbf8d56c1a7002eba438af2e7ae6f8398b2b0f4f381e3" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + source_gen_test: + dependency: transitive + description: + name: source_gen_test + sha256: b9727f4a5966d65a12e2b58bd54172e80800d8134f8d61c65f5e5a5176238914 + url: "https://pub.dev" + source: hosted + version: "1.3.1" + source_helper: + dependency: transitive + description: + name: source_helper + sha256: a447acb083d3a5ef17f983dd36201aeea33fedadb3228fa831f2f0c92f0f3aca + url: "https://pub.dev" + source: hosted + version: "1.3.7" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b + url: "https://pub.dev" + source: hosted + version: "2.1.2" + source_maps: + dependency: transitive + description: + name: source_maps + sha256: "190222579a448b03896e0ca6eca5998fa810fda630c1d65e2f78b3f638f54812" + url: "https://pub.dev" + source: hosted + version: "0.10.13" + source_span: + dependency: transitive + description: + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.dev" + source: hosted + version: "1.10.1" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" + source: hosted + version: "1.12.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 + url: "https://pub.dev" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + test: + dependency: transitive + description: + name: test + sha256: "65e29d831719be0591f7b3b1a32a3cda258ec98c58c7b25f7b84241bc31215bb" + url: "https://pub.dev" + source: hosted + version: "1.26.2" + test_api: + dependency: transitive + description: + name: test_api + sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" + url: "https://pub.dev" + source: hosted + version: "0.7.6" + test_core: + dependency: transitive + description: + name: test_core + sha256: "80bf5a02b60af04b09e14f6fe68b921aad119493e26e490deaca5993fef1b05a" + url: "https://pub.dev" + source: hosted + version: "0.6.11" + timing: + dependency: transitive + description: + name: timing + sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + uuid: + dependency: transitive + description: + name: uuid + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff + url: "https://pub.dev" + source: hosted + version: "4.5.1" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + url: "https://pub.dev" + source: hosted + version: "2.2.0" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + url: "https://pub.dev" + source: hosted + version: "14.3.1" + watcher: + dependency: "direct overridden" + description: + name: watcher + sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" + url: "https://pub.dev" + source: hosted + version: "0.1.6" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: "0b8e2457400d8a859b7b2030786835a28a8e80836ef64402abef392ff4f1d0e5" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" +sdks: + dart: ">=3.8.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 00000000..cb00afed --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,12 @@ +name: freezed_workspace + +environment: + sdk: "^3.7.0" + +workspace: + - benchmarks/ + - packages/freezed + - packages/freezed/example + - packages/freezed_annotation + - packages/freezed_lint + - packages/freezed_lint/example diff --git a/packages/freezed/pubspec_overrides.yaml b/pubspec_overrides.yaml similarity index 66% rename from packages/freezed/pubspec_overrides.yaml rename to pubspec_overrides.yaml index 6ba2de87..14d57cd1 100644 --- a/packages/freezed/pubspec_overrides.yaml +++ b/pubspec_overrides.yaml @@ -1,17 +1,18 @@ dependency_overrides: - freezed_annotation: - path: ../freezed_annotation # pub downgrade: # build_runner 2.2.0 => glob 2.0.0 => file 6.0.0 # freezed requires file: ^6.1.3 file: ^6.1.3 - # analyzer 5.2.0 => pub_semver 2.0.0 + # https://github.com/dart-lang/build/issues/3733#issuecomment-2272082820 + frontend_server_client: ^4.0.0 + # build_runner 2.3.3 => code_builder 4.2.0 => matcher 0.12.11 + # freezed requires matcher: ^0.12.15 + matcher: ^0.12.15 + # build_runner 2.3.3 => pub_semver 2.0.0 # freezed requires pub_semver: ^2.1.3 pub_semver: ^2.1.3 # expect_error 1.0.4 => pubspec 2.0.1 => uri 1.0.0 => quiver 3.0.0 # freezed requires quiver: ^3.2.0 quiver: ^3.2.0 - # watcher 1.0.0 extends, implements, or mixens sealed class 'FileSystemEvent' + # watcher 1.0.0 extends, implements, or mixins sealed class 'FileSystemEvent' watcher: ^1.1.0 - # https://github.com/dart-lang/build/issues/3733#issuecomment-2272082820 - frontend_server_client: ^4.0.0