Skip to content

Commit

Permalink
Removing the additional fields if item is singlevaluelist.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shashwat12-egov committed Nov 20, 2024
1 parent a7421d9 commit 897435d
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions packages/survey_form/lib/pages/survey_form_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,38 @@ class SurveyFormViewPageState extends LocalizedState<SurveyFormViewPage> {
);
},
),
BlocBuilder<ServiceBloc, ServiceState>(
builder: (context, state) {
return (controller[index].text == item.values?[1].trim() &&
!(isHealthFacilityWorker &&
widget.referralClientRefId != null) && item.dataType != 'SingleValueList')
? Padding(
padding: const EdgeInsets.only(
left: 4.0,
right: 4.0,
bottom: 16,
),
child: DigitTextField(
maxLength: 1000,
isRequired: true,
controller: additionalController[index],
label: localizations.translate(
'${selectedServiceDefinition?.code}.${item.code}.ADDITIONAL_FIELD',
),
validator: (value1) {
if (value1 == null || value1 == '') {
return localizations.translate(
i18.common.coreCommonReasonRequired,
);
}

return null;
},
),
)
: const SizedBox();
},
),
BlocBuilder<ServiceBloc, ServiceState>(
builder: (context, state) {
final hasError = (item.required == true &&
Expand Down

0 comments on commit 897435d

Please sign in to comment.