Skip to content

Commit 5a4c8f7

Browse files
authored
freezed3 (#189)
Co-authored-by: Vasiliy Ditsyak <[email protected]>
1 parent df2909d commit 5a4c8f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+5570
-6216
lines changed

packages/generator_tests/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ environment:
2323
resolution: workspace
2424

2525
dependencies:
26-
build: ^2.3.1
26+
build: ^2.4.2
2727
source_gen: ^2.0.0
2828
path: ^1.8.2
2929
build_runner: ^2.4.15
@@ -32,12 +32,12 @@ dependencies:
3232
recase: ^4.1.0
3333
reactive_forms_annotations:
3434
path: ../reactive_forms_annotations
35-
freezed_annotation: ^2.4.4
35+
freezed_annotation: ^3.0.0
3636

3737
dev_dependencies:
3838
json_serializable:
3939
build_test: ^2.2.3
40-
freezed: ^2.5.8
40+
freezed: ^3.0.6
4141
test: ^1.25.15
4242
logging: ^1.3.0
4343
reactive_forms_generator:

packages/generator_tests/test/doc/create_output_test.dart

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void main() {
2525
2626
@Rf(output: true)
2727
@freezed
28-
class MSICreate with _\$MSICreate {
28+
abstract class MSICreate with _\$MSICreate {
2929
const factory MSICreate({
3030
String? id,
3131
String? businessNumber,
@@ -52,7 +52,7 @@ void main() {
5252
5353
@RfGroup()
5454
@freezed
55-
class Address with _\$Address {
55+
abstract class Address with _\$Address {
5656
const factory Address({
5757
@RfControl(validators: [RequiredValidator(), MaxLengthValidator(120)])
5858
String? street,
@@ -66,7 +66,7 @@ void main() {
6666
6767
@RfGroup<PrimaryContact>()
6868
@freezed
69-
class PrimaryContact with _\$PrimaryContact {
69+
abstract class PrimaryContact with _\$PrimaryContact {
7070
const factory PrimaryContact({
7171
@RfControl(validators: [RequiredValidator(), MaxLengthValidator(120)])
7272
String? fullName,
@@ -78,7 +78,7 @@ void main() {
7878
7979
@RfGroup<AdminContactInformation>()
8080
@freezed
81-
class AdminContactInformation with _\$AdminContactInformation {
81+
abstract class AdminContactInformation with _\$AdminContactInformation {
8282
const factory AdminContactInformation({
8383
@RfControl(validators: [RequiredValidator(), MaxLengthValidator(120)])
8484
String? firstName,
@@ -3090,7 +3090,7 @@ class AdminContactInformationForm
30903090
30913091
@Rf(output: true)
30923092
@freezed
3093-
class MSICreateOutput with _$MSICreateOutput {
3093+
abstract class MSICreateOutput with _$MSICreateOutput {
30943094
const factory MSICreateOutput(
30953095
{String? id,
30963096
String? businessNumber,
@@ -3109,7 +3109,7 @@ class MSICreateOutput with _$MSICreateOutput {
31093109
31103110
@RfGroup()
31113111
@freezed
3112-
class AddressOutput with _$AddressOutput {
3112+
abstract class AddressOutput with _$AddressOutput {
31133113
const factory AddressOutput(
31143114
{@RfControl(validators: [RequiredValidator(), MaxLengthValidator(120)])
31153115
required String street,
@@ -3123,7 +3123,7 @@ class AddressOutput with _$AddressOutput {
31233123
31243124
@RfGroup<PrimaryContactOutput>()
31253125
@freezed
3126-
class PrimaryContactOutput with _$PrimaryContactOutput {
3126+
abstract class PrimaryContactOutput with _$PrimaryContactOutput {
31273127
const factory PrimaryContactOutput(
31283128
{@RfControl(validators: [RequiredValidator(), MaxLengthValidator(120)])
31293129
required String fullName,
@@ -3134,7 +3134,8 @@ class PrimaryContactOutput with _$PrimaryContactOutput {
31343134
31353135
@RfGroup<AdminContactInformationOutput>()
31363136
@freezed
3137-
class AdminContactInformationOutput with _$AdminContactInformationOutput {
3137+
abstract class AdminContactInformationOutput
3138+
with _$AdminContactInformationOutput {
31383139
const factory AdminContactInformationOutput(
31393140
{@RfControl(validators: [RequiredValidator(), MaxLengthValidator(120)])
31403141
required String firstName,

packages/generator_tests/test/doc/freezed_class_output_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void main() {
2626
2727
@freezed
2828
@Rf(output: true)
29-
class FreezedClassO with _\$FreezedClassO {
29+
abstract class FreezedClassO with _\$FreezedClassO {
3030
FreezedClassO._();
3131
3232
factory FreezedClassO(
@@ -1369,7 +1369,7 @@ class FreezedClassOForm
13691369
13701370
@freezed
13711371
@Rf(output: true)
1372-
class FreezedClassOOutput with _$FreezedClassOOutput {
1372+
abstract class FreezedClassOOutput with _$FreezedClassOOutput {
13731373
FreezedClassOOutput._();
13741374
factory FreezedClassOOutput(@RfControl<String>() String? gender,
13751375
@RfControl(validators: [RequiredValidator()]) String genderR,

packages/generator_tests/test/doc/freezed_class_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void main() {
2626
2727
@freezed
2828
@Rf(output: false)
29-
class FreezedClass with _\$FreezedClass {
29+
abstract class FreezedClass with _\$FreezedClass {
3030
FreezedClass._();
3131
3232
factory FreezedClass(

packages/generator_tests/test/doc/generic_output_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void main() {
2121
2222
@freezed
2323
@Rf(output: true)
24-
class TagsO<T> with _\$TagsO<T> {
24+
abstract class TagsO<T> with _\$TagsO<T> {
2525
factory TagsO({
2626
@RfControl() required List<T>? tags,
2727
}) = _TagsO;
@@ -491,7 +491,7 @@ class TagsOForm<T> implements FormModel<TagsO<T>, TagsOOutput<T>> {
491491
492492
@freezed
493493
@Rf(output: true)
494-
class TagsOOutput<T> with _$TagsOOutput<T> {
494+
abstract class TagsOOutput<T> with _$TagsOOutput<T> {
495495
factory TagsOOutput({@RfControl() required List<T>? tags}) = _TagsOOutput;
496496
const TagsOOutput._();
497497
}

packages/generator_tests/test/doc/generic_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void main() {
2121
2222
@freezed
2323
@Rf(output: false)
24-
class Tags<T> with _$Tags<T> {
24+
abstract class Tags<T> with _$Tags<T> {
2525
factory Tags({
2626
@RfControl() required List<T>? tags,
2727
}) = _Tags;

packages/generator_tests/test/doc/nested_generic_output_test.dart

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void main() {
2121
2222
@freezed
2323
@Rf(output: true)
24-
class ProductDetailsO<P extends Product, C extends Cart>
24+
abstract class ProductDetailsO<P extends Product, C extends Cart>
2525
with _\$ProductDetailsO<P, C> {
2626
factory ProductDetailsO({
2727
@RfControl() String? description,
@@ -34,7 +34,7 @@ void main() {
3434
@freezed
3535
@Rf(output: false)
3636
@RfGroup()
37-
class IdO<P extends Product, C extends Cart> with _\$IdO<P, C> {
37+
abstract class IdO<P extends Product, C extends Cart> with _\$IdO<P, C> {
3838
factory IdO({
3939
@RfControl() String? companyName,
4040
@RfControl() String? name,
@@ -44,7 +44,7 @@ void main() {
4444
}
4545
4646
@freezed
47-
class Product with _\$Product {
47+
abstract class Product with _\$Product {
4848
const factory Product({
4949
String? companyName,
5050
String? name,
@@ -54,7 +54,7 @@ void main() {
5454
}
5555
5656
@freezed
57-
class Cart with _\$Cart {
57+
abstract class Cart with _\$Cart {
5858
const factory Cart({
5959
Product? product,
6060
String? description,
@@ -1003,7 +1003,7 @@ class IdOForm<P extends Product, C extends Cart>
10031003
10041004
@freezed
10051005
@Rf(output: true)
1006-
class ProductDetailsOOutput<P extends Product, C extends Cart>
1006+
abstract class ProductDetailsOOutput<P extends Product, C extends Cart>
10071007
with _$ProductDetailsOOutput<P, C> {
10081008
factory ProductDetailsOOutput(
10091009
{@RfControl() String? description,
@@ -1014,7 +1014,8 @@ class ProductDetailsOOutput<P extends Product, C extends Cart>
10141014
@freezed
10151015
@Rf(output: false)
10161016
@RfGroup()
1017-
class IdOOutput<P extends Product, C extends Cart> with _$IdOOutput<P, C> {
1017+
abstract class IdOOutput<P extends Product, C extends Cart>
1018+
with _$IdOOutput<P, C> {
10181019
factory IdOOutput(
10191020
{@RfControl() String? companyName,
10201021
@RfControl() String? name}) = _IdOOutput;

packages/generator_tests/test/doc/nested_generic_test.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ void main() {
99
group('reactive_forms_generator', () {
1010
test(
1111
'Nested generics',
12-
() async {
12+
() async {
1313
return testGenerator(
1414
fileName: fileName,
1515
model: '''
@@ -21,7 +21,7 @@ void main() {
2121
2222
@freezed
2323
@Rf(output: false)
24-
class ProductDetails<P extends Product, C extends Cart>
24+
abstract class ProductDetails<P extends Product, C extends Cart>
2525
with _\$ProductDetails<P, C> {
2626
factory ProductDetails({
2727
@RfControl() String? description,
@@ -34,7 +34,7 @@ void main() {
3434
@freezed
3535
@Rf(output: false)
3636
@RfGroup()
37-
class Id<P extends Product, C extends Cart> with _\$Id<P, C> {
37+
abstract class Id<P extends Product, C extends Cart> with _\$Id<P, C> {
3838
factory Id({
3939
@RfControl() String? companyName,
4040
@RfControl() String? name,
@@ -44,7 +44,7 @@ void main() {
4444
}
4545
4646
@freezed
47-
class Product with _\$Product {
47+
abstract class Product with _\$Product {
4848
const factory Product({
4949
String? companyName,
5050
String? name,
@@ -54,7 +54,7 @@ void main() {
5454
}
5555
5656
@freezed
57-
class Cart with _\$Cart {
57+
abstract class Cart with _\$Cart {
5858
const factory Cart({
5959
Product? product,
6060
String? description,

packages/generator_tests/test/doc/nested_output.test.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void main() {
2525
@Rf(output: true)
2626
@RfGroup()
2727
@freezed
28-
class SubGroupO with _\$SubGroupO {
28+
abstract class SubGroupO with _\$SubGroupO {
2929
const factory SubGroupO({
3030
@RfControl() required String id,
3131
}) = _SubGroupO;
@@ -37,7 +37,7 @@ void main() {
3737
@Rf(output: true)
3838
@RfGroup()
3939
@freezed
40-
class GroupO with _\$GroupO {
40+
abstract class GroupO with _\$GroupO {
4141
const factory GroupO({
4242
@RfControl() required String id,
4343
@RfArray<dynamic>() required List<SubGroupO> subGroupList,
@@ -49,7 +49,7 @@ void main() {
4949
@Rf(output: true)
5050
@RfGroup()
5151
@freezed
52-
class NestedO with _\$NestedO {
52+
abstract class NestedO with _\$NestedO {
5353
const factory NestedO({
5454
@RfArray<dynamic>() required List<GroupO> groupList,
5555
}) = _NestedO;
@@ -493,7 +493,7 @@ class SubGroupOForm implements FormModel<SubGroupO, SubGroupOOutput> {
493493
@Rf(output: true)
494494
@RfGroup()
495495
@freezed
496-
class SubGroupOOutput with _$SubGroupOOutput {
496+
abstract class SubGroupOOutput with _$SubGroupOOutput {
497497
const factory SubGroupOOutput({@RfControl() required String id}) =
498498
_SubGroupOOutput;
499499
factory SubGroupOOutput.fromJson(Map<String, dynamic> json) =>
@@ -503,7 +503,7 @@ class SubGroupOOutput with _$SubGroupOOutput {
503503
@Rf(output: true)
504504
@RfGroup()
505505
@freezed
506-
class GroupOOutput with _$GroupOOutput {
506+
abstract class GroupOOutput with _$GroupOOutput {
507507
const factory GroupOOutput(
508508
{@RfControl() required String id,
509509
@RfArray<dynamic>() required List<SubGroupOOutput> subGroupList}) =
@@ -515,7 +515,7 @@ class GroupOOutput with _$GroupOOutput {
515515
@Rf(output: true)
516516
@RfGroup()
517517
@freezed
518-
class NestedOOutput with _$NestedOOutput {
518+
abstract class NestedOOutput with _$NestedOOutput {
519519
const factory NestedOOutput(
520520
{@RfArray<dynamic>() required List<GroupOOutput> groupList}) =
521521
_NestedOOutput;

packages/generator_tests/test/doc/profile_output_test.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void main() {
5959
6060
@freezed
6161
@Rf(output: true)
62-
class ProfileO with _\$ProfileO {
62+
abstract class ProfileO with _\$ProfileO {
6363
const ProfileO._();
6464
6565
factory ProfileO(
@@ -82,7 +82,7 @@ void main() {
8282
8383
@freezed
8484
@RfGroup()
85-
class ThresholdSettingO with _\$ThresholdSettingO {
85+
abstract class ThresholdSettingO with _\$ThresholdSettingO {
8686
static const values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
8787
8888
const factory ThresholdSettingO({
@@ -96,7 +96,7 @@ void main() {
9696
9797
@freezed
9898
@RfGroup()
99-
class TimerSettingO with _\$TimerSettingO {
99+
abstract class TimerSettingO with _\$TimerSettingO {
100100
static const values = [1, 2, 3, 4, 5, 6];
101101
102102
const factory TimerSettingO({
@@ -110,7 +110,7 @@ void main() {
110110
111111
@RfGroup()
112112
@freezed
113-
class IncidenceFilterO with _\$IncidenceFilterO {
113+
abstract class IncidenceFilterO with _\$IncidenceFilterO {
114114
const factory IncidenceFilterO({
115115
@RfControl<bool>() @Default(true) bool isMobilityEnabled,
116116
@RfControl<bool>() @Default(true) bool isFurcationEnabled,
@@ -137,7 +137,7 @@ void main() {
137137
enum ToothSide { facial, lingual }
138138
139139
@freezed
140-
class ScanOrder with _\$ScanOrder {
140+
abstract class ScanOrder with _\$ScanOrder {
141141
const factory ScanOrder.arch(
142142
Jaw jaw, {
143143
required Direction direction,
@@ -155,7 +155,7 @@ void main() {
155155
}
156156
157157
@freezed
158-
class ChartingOrderValue with _\$ChartingOrderValue {
158+
abstract class ChartingOrderValue with _\$ChartingOrderValue {
159159
const factory ChartingOrderValue({
160160
@Default(ChartingOrderType.arch) ChartingOrderType chartingOrder,
161161
@Default(0) int selectedOption,
@@ -2759,7 +2759,7 @@ class TimerSettingOForm
27592759
27602760
@freezed
27612761
@Rf(output: true)
2762-
class ProfileOOutput with _$ProfileOOutput {
2762+
abstract class ProfileOOutput with _$ProfileOOutput {
27632763
const ProfileOOutput._();
27642764
factory ProfileOOutput(String id,
27652765
{required String anotherId,
@@ -2779,7 +2779,7 @@ class ProfileOOutput with _$ProfileOOutput {
27792779
27802780
@freezed
27812781
@RfGroup()
2782-
class ThresholdSettingOOutput with _$ThresholdSettingOOutput {
2782+
abstract class ThresholdSettingOOutput with _$ThresholdSettingOOutput {
27832783
static const values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
27842784
const factory ThresholdSettingOOutput(
27852785
{@RfControl<bool>() @Default(true) bool isEnabled,
@@ -2790,7 +2790,7 @@ class ThresholdSettingOOutput with _$ThresholdSettingOOutput {
27902790
27912791
@freezed
27922792
@RfGroup()
2793-
class TimerSettingOOutput with _$TimerSettingOOutput {
2793+
abstract class TimerSettingOOutput with _$TimerSettingOOutput {
27942794
static const values = [1, 2, 3, 4, 5, 6];
27952795
const factory TimerSettingOOutput(
27962796
{@RfControl<bool>() @Default(false) bool isEnabled,
@@ -2801,7 +2801,7 @@ class TimerSettingOOutput with _$TimerSettingOOutput {
28012801
28022802
@RfGroup()
28032803
@freezed
2804-
class IncidenceFilterOOutput with _$IncidenceFilterOOutput {
2804+
abstract class IncidenceFilterOOutput with _$IncidenceFilterOOutput {
28052805
const factory IncidenceFilterOOutput(
28062806
{@RfControl<bool>() @Default(true) bool isMobilityEnabled,
28072807
@RfControl<bool>() @Default(true) bool isFurcationEnabled,

0 commit comments

Comments
 (0)