diff --git a/lib/src/models/work_item_fields.dart b/lib/src/models/work_item_fields.dart index d2336dc3..d90204a1 100644 --- a/lib/src/models/work_item_fields.dart +++ b/lib/src/models/work_item_fields.dart @@ -33,6 +33,7 @@ class WorkItemField { required this.referenceName, required this.name, this.required = false, + this.alwaysRequired = false, this.readOnly = false, this.defaultValue, this.allowedValues = const [], @@ -43,7 +44,7 @@ class WorkItemField { factory WorkItemField.fromJson(Map json) => WorkItemField( referenceName: json['referenceName'] as String, name: json['name'] as String, - required: json['alwaysRequired'] as bool? ?? false, + alwaysRequired: json['alwaysRequired'] as bool? ?? false, readOnly: json['readOnly'] as bool? ?? false, defaultValue: json['defaultValue'] as String?, allowedValues: (json['allowedValues'] as List?)?.map((v) => v.toString()).toList() ?? [], @@ -53,6 +54,7 @@ class WorkItemField { final String referenceName; final String name; + bool alwaysRequired; bool required; bool readOnly; final String? defaultValue; diff --git a/lib/src/screens/create_or_edit_work_item/controller_create_or_edit_work_item.dart b/lib/src/screens/create_or_edit_work_item/controller_create_or_edit_work_item.dart index 7393040d..a288b05e 100644 --- a/lib/src/screens/create_or_edit_work_item/controller_create_or_edit_work_item.dart +++ b/lib/src/screens/create_or_edit_work_item/controller_create_or_edit_work_item.dart @@ -504,7 +504,7 @@ class _CreateOrEditWorkItemController with FilterMixin, AppLogger { final rules = checker.checkRules(field); field ..readOnly = rules.readOnly || rules.makeEmpty - ..required = rules.required; + ..required = field.alwaysRequired || rules.required; final refName = field.referenceName;