@@ -32,10 +32,12 @@ class PropertySchema with _$PropertySchema {
3232 PropertySchemaFormat ? format,
3333 @JsonKey (fromJson: _stringOrNull) final String ? startDate,
3434 @JsonKey (fromJson: _stringOrNull) final String ? endDate,
35- int ? minValue,
36- int ? maxValue,
37- int ? minLength,
38- int ? maxLength,
35+ @JsonKey (fromJson: _intOrNull) int ? minValue,
36+ @JsonKey (fromJson: _intOrNull) int ? maxValue,
37+ @JsonKey (fromJson: _intOrNull) int ? minLength,
38+ @JsonKey (fromJson: _intOrNull) int ? maxLength,
39+ @JsonKey (fromJson: _intOrNull) int ? min,
40+ @JsonKey (fromJson: _intOrNull) int ? max,
3941 String ? helpText,
4042 String ? tooltip,
4143 String ? prefixText,
@@ -118,13 +120,23 @@ class NavigateToConfig with _$NavigateToConfig {
118120@freezed
119121class VisibilityCondition with _$VisibilityCondition {
120122 const factory VisibilityCondition ({
121- required String expression,
123+ required List < VisibilityExpression > expression,
122124 }) = _VisibilityCondition ;
123125
124126 factory VisibilityCondition .fromJson (Map <String , dynamic > json) =>
125127 _$VisibilityConditionFromJson (json);
126128}
127129
130+ @freezed
131+ class VisibilityExpression with _$VisibilityExpression {
132+ const factory VisibilityExpression ({
133+ required String condition,
134+ }) = _VisibilityExpression ;
135+
136+ factory VisibilityExpression .fromJson (Map <String , dynamic > json) =>
137+ _$VisibilityExpressionFromJson (json);
138+ }
139+
128140@freezed
129141class ConditionalNavigateTo with _$ConditionalNavigateTo {
130142 const factory ConditionalNavigateTo ({
@@ -187,6 +199,14 @@ String? _stringOrNull(dynamic value) {
187199 return value is String ? value : null ;
188200}
189201
202+ int ? _intOrNull (dynamic value) {
203+ if (value == null ) return null ;
204+ if (value is int ) return value;
205+ if (value is num ) return value.toInt ();
206+ if (value is String ) return int .tryParse (value);
207+ return null ;
208+ }
209+
190210NavigateToConfig ? _navigateToConfigOrNull (dynamic value) {
191211 if (value is Map && value.isEmpty) {
192212 return null ; // Treat {} as null
0 commit comments