From c81d3181d232a298f1900c1936a2f8c9b48c45b6 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Mon, 23 Feb 2026 13:46:28 +0300 Subject: [PATCH] acknowledgment added for demo request creation. --- .../demo_module/create_demo_request_page.dart | 57 +++++++++++++++++ .../demo_module/models/demo_form_model.dart | 62 ++++++++++--------- .../widgets/equipment/asset_detail_page.dart | 2 +- 3 files changed, 92 insertions(+), 29 deletions(-) diff --git a/lib/modules/demo_module/create_demo_request_page.dart b/lib/modules/demo_module/create_demo_request_page.dart index fffa24c7..4ea8d1ad 100644 --- a/lib/modules/demo_module/create_demo_request_page.dart +++ b/lib/modules/demo_module/create_demo_request_page.dart @@ -154,6 +154,62 @@ class _CreateDemoRequestPageState extends State with Tick setState(() {}); }, ), + 16.height, + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Checkbox( + value: _demoFormModel.demoEaluationAcknowledge, + visualDensity: const VisualDensity(horizontal: -4, vertical: -4), + activeColor: AppColor.blueStatus(context), + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + onChanged: (value) { + setState(() { + _demoFormModel.demoEaluationAcknowledge = value!; + }); + }), + 8.width, + Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "DEMO outcome evaluation form acknowledgement".bodyText(context).custom(color: context.isDark ? AppColor.primary50 : AppColor.neutral50), + 4.height, + "I acknowledge at the end of the trial period I will complete and submit the Medical Technology Trial Outcome Form within two weeks." + .tinyFont(context) + .custom(color: context.isDark ? AppColor.primary50 : AppColor.neutral120), + ], + ).expanded, + ], + ), + 16.height, + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Checkbox( + value: _demoFormModel.acknowledgeNotEquipment, + visualDensity: const VisualDensity(horizontal: -4, vertical: -4), + activeColor: AppColor.blueStatus(context), + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + onChanged: (value) { + setState(() { + _demoFormModel.acknowledgeNotEquipment = value!; + }); + }), + 8.width, + Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Acknowledgement of not using the equipment".bodyText(context).custom(color: context.isDark ? AppColor.primary50 : AppColor.neutral50), + 4.height, + "I acknowledge at the end of the trial period I will not use the DEMO medical equipment & I will not book any patient on the DEMO medical equipment." + .tinyFont(context) + .custom(color: context.isDark ? AppColor.primary50 : AppColor.neutral120), + ], + ).expanded, + ], + ), ], ).toShadowContainer(context, borderRadius: 20), ).expanded, @@ -161,6 +217,7 @@ class _CreateDemoRequestPageState extends State with Tick context: context, child: AppFilledButton( buttonColor: AppColor.primary10, + disableButton: !_demoFormModel.demoEaluationAcknowledge || !_demoFormModel.acknowledgeNotEquipment, label: context.translation.submitRequest, onPressed: _submit, // buttonColor: AppColor.primary10, diff --git a/lib/modules/demo_module/models/demo_form_model.dart b/lib/modules/demo_module/models/demo_form_model.dart index afe16908..c591dd98 100644 --- a/lib/modules/demo_module/models/demo_form_model.dart +++ b/lib/modules/demo_module/models/demo_form_model.dart @@ -34,6 +34,9 @@ class DemoFormModel { SupplierDetails? vendor; List? demoAttachment; + bool demoEaluationAcknowledge; + bool acknowledgeNotEquipment; + DemoFormModel({ this.id, this.docName, @@ -54,6 +57,8 @@ class DemoFormModel { this.vendor, this.supEngineer, this.department, + this.demoEaluationAcknowledge = false, + this.acknowledgeNotEquipment = false, }); Map toJson() { @@ -79,36 +84,37 @@ class DemoFormModel { "demoPeriodId": demoPeriod?.id, "supplierId": vendor?.id, "suppPersonId": supEngineer?.id, - // "vendorEmail": vendorEmail, + "demoEaluationAcknowledge": demoEaluationAcknowledge, + "acknowledgeNotEquipment": acknowledgeNotEquipment, "demoAttachments": - // [ - // { - // "id": 3, - // // "documentType": { - // // "id": 7748, - // // "name": "February", - // // "value": 2 - // // }, - // "documentTypeId": 7748, - // "attachmentName": "6c9f50b0-1c92-4ae9-ae64-7c284c61ea72.jpg", - // "originalName": "scaled_d245df97-1289-4d0c-92a0-569abedfb0db8154518103327960943.jpg", - // "demoRequestId": 3 - // }, - // { - // "id": 4, - // // "documentType": { - // // "id": 7748, - // // "name": "February", - // // "value": 2 - // // }, - // "documentTypeId": 7748, - // "attachmentName": "346e04f6-0f9b-4004-ad85-4cdbf8318f7c.jpg", - // "originalName": "scaled_85790b6c-7b16-46e6-891c-11c316d5897a2973693360957767376.jpg", - // "demoRequestId": 3 - // } - // ] + // [ + // { + // "id": 3, + // // "documentType": { + // // "id": 7748, + // // "name": "February", + // // "value": 2 + // // }, + // "documentTypeId": 7748, + // "attachmentName": "6c9f50b0-1c92-4ae9-ae64-7c284c61ea72.jpg", + // "originalName": "scaled_d245df97-1289-4d0c-92a0-569abedfb0db8154518103327960943.jpg", + // "demoRequestId": 3 + // }, + // { + // "id": 4, + // // "documentType": { + // // "id": 7748, + // // "name": "February", + // // "value": 2 + // // }, + // "documentTypeId": 7748, + // "attachmentName": "346e04f6-0f9b-4004-ad85-4cdbf8318f7c.jpg", + // "originalName": "scaled_85790b6c-7b16-46e6-891c-11c316d5897a2973693360957767376.jpg", + // "demoRequestId": 3 + // } + // ] - demoAttachment != null ? demoAttachment!.map((v) => v.toJson()).toList() : [], + demoAttachment != null ? demoAttachment!.map((v) => v.toJson()).toList() : [], }; } diff --git a/lib/views/widgets/equipment/asset_detail_page.dart b/lib/views/widgets/equipment/asset_detail_page.dart index f0b095fb..542667db 100644 --- a/lib/views/widgets/equipment/asset_detail_page.dart +++ b/lib/views/widgets/equipment/asset_detail_page.dart @@ -41,7 +41,7 @@ class _AssetDetailPageState extends State { AssetProvider? _assetProvider; @override - Widget build(BuildContext context) { + Widget build(BuildContext context) {_assetProvider!.getAssetById(assetId!, context.translation); assetId ??= ModalRoute.of(context)?.settings.arguments as int; _assetProvider ??= Provider.of(context, listen: false); _assetProvider?.stateCode = null;