@@ -10,15 +10,15 @@ final class VineArrayRule implements VineRule {
1010 const VineArrayRule (this .schema);
1111
1212 @override
13- void handle (VineValidationContext ctx, FieldContext field) {
13+ void handle (VineValidationContext ctx, VineFieldContext field) {
1414 final copy = field.customKeys;
1515
1616 if (field.value case List values) {
1717 final currentSchema = schema as RuleParser ;
1818 final copyRules = currentSchema.rules.toList ();
1919
2020 for (int i = 0 ; i < values.length; i++ ) {
21- final currentField = FieldPool .acquire (field.name, values[i]);
21+ final currentField = VineFieldPool .acquire (field.name, values[i]);
2222
2323 currentSchema.rules.clear ();
2424 currentSchema.rules.addAll (copyRules);
@@ -31,7 +31,7 @@ final class VineArrayRule implements VineRule {
3131 ..addAll (copy);
3232
3333 currentField.mutate ([...field.value, currentField.value]);
34- FieldPool .release (currentField);
34+ VineFieldPool .release (currentField);
3535 }
3636
3737 return ;
@@ -48,19 +48,23 @@ final class VineArrayUniqueRule implements VineRule {
4848 const VineArrayUniqueRule (this .message);
4949
5050 @override
51- void handle (VineValidationContext ctx, FieldContext field) {
51+ void handle (VineValidationContext ctx, VineFieldContext field) {
5252 if (field.value is ! List ) {
53- final error = ctx.errorReporter.format ('array.unique' , field, message, {});
54- ctx.errorReporter.report ('array.unique' , [...field.customKeys, field.name], error);
53+ final error =
54+ ctx.errorReporter.format ('array.unique' , field, message, {});
55+ ctx.errorReporter
56+ .report ('array.unique' , [...field.customKeys, field.name], error);
5557 return ;
5658 }
5759
5860 final values = field.value as List ;
5961 final unique = values.toSet ().toList ();
6062
6163 if (values.length != unique.length) {
62- final error = ctx.errorReporter.format ('array.unique' , field, message, {});
63- ctx.errorReporter.report ('array.unique' , [...field.customKeys, field.name], error);
64+ final error =
65+ ctx.errorReporter.format ('array.unique' , field, message, {});
66+ ctx.errorReporter
67+ .report ('array.unique' , [...field.customKeys, field.name], error);
6468 }
6569 }
6670}
@@ -72,13 +76,15 @@ final class VineArrayMinLengthRule implements VineRule {
7276 const VineArrayMinLengthRule (this .minValue, this .message);
7377
7478 @override
75- void handle (VineValidationContext ctx, FieldContext field) {
79+ void handle (VineValidationContext ctx, VineFieldContext field) {
7680 if ((field.value as List ).length < minValue) {
77- final error = ctx.errorReporter.format ('array.minLength' , field, message, {
81+ final error =
82+ ctx.errorReporter.format ('array.minLength' , field, message, {
7883 'min' : minValue,
7984 });
8085
81- ctx.errorReporter.report ('array.minLength' , [...field.customKeys, field.name], error);
86+ ctx.errorReporter
87+ .report ('array.minLength' , [...field.customKeys, field.name], error);
8288 }
8389 }
8490}
@@ -90,13 +96,15 @@ final class VineArrayMaxLengthRule implements VineRule {
9096 const VineArrayMaxLengthRule (this .maxValue, this .message);
9197
9298 @override
93- void handle (VineValidationContext ctx, FieldContext field) {
99+ void handle (VineValidationContext ctx, VineFieldContext field) {
94100 if ((field.value as List ).length > maxValue) {
95- final error = ctx.errorReporter.format ('array.maxLength' , field, message, {
101+ final error =
102+ ctx.errorReporter.format ('array.maxLength' , field, message, {
96103 'max' : maxValue,
97104 });
98105
99- ctx.errorReporter.report ('array.maxLength' , [...field.customKeys, field.name], error);
106+ ctx.errorReporter
107+ .report ('array.maxLength' , [...field.customKeys, field.name], error);
100108 }
101109 }
102110}
@@ -108,12 +116,14 @@ final class VineArrayFixedLengthRule implements VineRule {
108116 const VineArrayFixedLengthRule (this .count, this .message);
109117
110118 @override
111- void handle (VineValidationContext ctx, FieldContext field) {
119+ void handle (VineValidationContext ctx, VineFieldContext field) {
112120 if ((field.value as List ).length != count) {
113- final error = ctx.errorReporter.format ('array.fixedLength' , field, message, {
121+ final error =
122+ ctx.errorReporter.format ('array.fixedLength' , field, message, {
114123 'length' : count,
115124 });
116- ctx.errorReporter.report ('array.fixedLength' , [...field.customKeys, field.name], error);
125+ ctx.errorReporter.report (
126+ 'array.fixedLength' , [...field.customKeys, field.name], error);
117127 }
118128 }
119129}
0 commit comments