From 3372f7d38dd00a1406b92d911459663ab190c9d5 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Wed, 28 Jan 2026 10:40:22 +0300 Subject: [PATCH 1/4] demo attachment document type added. --- lib/controllers/api_routes/urls.dart | 1 + lib/main.dart | 2 ++ lib/models/generic_attachment_model.dart | 10 ++++-- .../demo_module/create_demo_request_page.dart | 26 +++++++++++++-- .../demo_document_lookup_provider.dart | 33 +++++++++++++++++++ .../widgets/images/multi_image_picker.dart | 9 +++-- 6 files changed, 73 insertions(+), 8 deletions(-) create mode 100644 lib/modules/demo_module/demo_document_lookup_provider.dart diff --git a/lib/controllers/api_routes/urls.dart b/lib/controllers/api_routes/urls.dart index eed578cf..e6c1f6e5 100644 --- a/lib/controllers/api_routes/urls.dart +++ b/lib/controllers/api_routes/urls.dart @@ -247,6 +247,7 @@ class URLs { static get getYesNoRequestTypeLookup => "$_baseUrl/Lookups/GetLookup?lookupEnum=4"; static get getDemoPeriodLookup => "$_baseUrl/Lookups/GetLookup?lookupEnum=4101"; + static get getDemoDocumentTypes => "$_baseUrl/Lookups/GetLookup?lookupEnum=4104"; static get getClassificationTypeLookup => "$_baseUrl/Lookups/GetLookup?lookupEnum=450"; diff --git a/lib/main.dart b/lib/main.dart index 20701c5c..263657ce 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -119,6 +119,7 @@ import 'controllers/providers/api/gas_refill_comments.dart'; import 'controllers/providers/api/user_provider.dart'; import 'controllers/providers/settings/setting_provider.dart'; import 'dashboard_latest/dashboard_provider.dart'; +import 'modules/demo_module/demo_document_lookup_provider.dart'; import 'modules/internal_audit_module/pages/equipment_internal_audit/update_equipment_internal_audit_page.dart'; import 'modules/internal_audit_module/provider/internal_audit_checklist_provider.dart'; import 'modules/cx_module/survey/survey_provider.dart'; @@ -343,6 +344,7 @@ class MyApp extends StatelessWidget { ChangeNotifierProvider(create: (_) => MedicalGasSupplierProvider()), ChangeNotifierProvider(create: (_) => DemoProvider()), ChangeNotifierProvider(create: (_) => DemoPeriodLookupProvider()), + ChangeNotifierProvider(create: (_) => DemoDocumentLookupProvider()), ], child: GestureDetector( onTap: () { diff --git a/lib/models/generic_attachment_model.dart b/lib/models/generic_attachment_model.dart index c0c2b4cf..dde1d74d 100644 --- a/lib/models/generic_attachment_model.dart +++ b/lib/models/generic_attachment_model.dart @@ -1,12 +1,16 @@ import 'dart:io'; +import 'package:test_sa/models/lookup.dart'; + class GenericAttachmentModel { - GenericAttachmentModel({this.id, this.name,this.originalName,this.createdBy}); + GenericAttachmentModel({this.id, this.name, this.originalName, this.createdBy,this.documentTypeId}); int? id; String? name; - String ?createdBy; + String? createdBy; String? originalName; + Lookup? documentTypeId; + GenericAttachmentModel.fromJson(Map json) { id = json['id']; name = json['name']; @@ -22,4 +26,4 @@ class GenericAttachmentModel { data['originalName'] = originalName; return data; } -} \ No newline at end of file +} diff --git a/lib/modules/demo_module/create_demo_request_page.dart b/lib/modules/demo_module/create_demo_request_page.dart index 69c981e6..79aec114 100644 --- a/lib/modules/demo_module/create_demo_request_page.dart +++ b/lib/modules/demo_module/create_demo_request_page.dart @@ -40,6 +40,7 @@ import 'package:test_sa/providers/work_order/vendor_provider.dart'; import 'package:test_sa/views/widgets/images/multi_image_picker.dart'; import '../../../../../../new_views/common_widgets/default_app_bar.dart'; import 'demo_detail_view_page.dart'; +import 'demo_document_lookup_provider.dart'; import 'demo_form_model.dart'; class CreateDemoRequestPage extends StatefulWidget { @@ -63,6 +64,7 @@ class _CreateDemoRequestPageState extends State with Tick SupplierDetails? supplier; Lookup? demoPeriodLookup; + Lookup? demoDocumentLookup; // List loanTypes = []; @@ -114,13 +116,33 @@ class _CreateDemoRequestPageState extends State with Tick 16.height, ...vendorDetailsSection(), 16.height, + SingleItemDropDownMenu( + context: context, + height: 56.toScreenHeight, + title: "Document Type", + initialValue: demoDocumentLookup, + showShadow: false, + validator: (value) { + if (value == null) return "Mandatory"; + return null; + }, + backgroundColor: AppColor.fieldBgColor(context), + showAsBottomSheet: true, + onSelect: (value) { + demoDocumentLookup = value; + setState(() {}); + }, + ), + 16.height, AttachmentPicker( label: context.translation.attachments, attachment: attachments, - buttonColor: AppColor.black10, + buttonColor: AppColor.black10.withOpacity(demoDocumentLookup != null ? 1 : .4), onlyImages: false, + enabled: demoDocumentLookup != null, + documentType: demoDocumentLookup, showAsListView: true, - buttonIcon: 'image-plus'.toSvgAsset(color: context.isDark ? AppColor.primary10 : AppColor.neutral120), + buttonIcon: 'image-plus'.toSvgAsset(color: (context.isDark ? AppColor.primary10 : AppColor.neutral120).withOpacity(demoDocumentLookup != null ? 1 : .4)), onChange: (attachments) { attachments = attachments; setState(() {}); diff --git a/lib/modules/demo_module/demo_document_lookup_provider.dart b/lib/modules/demo_module/demo_document_lookup_provider.dart new file mode 100644 index 00000000..07f3e2f2 --- /dev/null +++ b/lib/modules/demo_module/demo_document_lookup_provider.dart @@ -0,0 +1,33 @@ +import 'dart:convert'; + +import 'package:http/http.dart'; +import 'package:test_sa/providers/loading_list_notifier.dart'; + +import '../../controllers/api_routes/api_manager.dart'; +import '../../controllers/api_routes/urls.dart'; +import '../../models/lookup.dart'; + +class DemoDocumentLookupProvider extends LoadingListNotifier { + @override + Future getData({int? id}) async { + if (loading == true) return -2; + loading = true; + notifyListeners(); + try { + Response response = await ApiManager.instance.get(URLs.getDemoDocumentTypes); + stateCode = response.statusCode; + if (response.statusCode >= 200 && response.statusCode < 300) { + List categoriesListJson = json.decode(response.body)["data"]; + items = categoriesListJson.map((item) => Lookup.fromJson(item)).toList(); + } + loading = false; + notifyListeners(); + return response.statusCode; + } catch (error) { + loading = false; + stateCode = -1; + notifyListeners(); + return -1; + } + } +} diff --git a/lib/views/widgets/images/multi_image_picker.dart b/lib/views/widgets/images/multi_image_picker.dart index e2973118..4278901f 100644 --- a/lib/views/widgets/images/multi_image_picker.dart +++ b/lib/views/widgets/images/multi_image_picker.dart @@ -9,6 +9,7 @@ import 'package:test_sa/extensions/int_extensions.dart'; import 'package:test_sa/extensions/text_extensions.dart'; import 'package:test_sa/extensions/widget_extensions.dart'; import 'package:test_sa/models/generic_attachment_model.dart'; +import 'package:test_sa/models/lookup.dart'; import 'package:test_sa/new_views/app_style/app_color.dart'; import '../../../new_views/common_widgets/app_dashed_button.dart'; @@ -321,6 +322,7 @@ class AttachmentPicker extends StatefulWidget { final Function(List)? onChange; final bool showAsGrid; final bool showAsListView; + Lookup? documentType; AttachmentPicker( {Key? key, @@ -332,6 +334,7 @@ class AttachmentPicker extends StatefulWidget { this.enabled = true, this.onlyImages = false, this.onChange, + this.documentType, this.showAsGrid = false, this.showAsListView = false, this.buttonColor}) @@ -419,7 +422,7 @@ class _AttachmentPickerState extends State { ); if (result != null) { for (var path in result.paths) { - widget.attachment.add(GenericAttachmentModel(id: 0, name: File(path!).path)); + widget.attachment.add(GenericAttachmentModel(id: 0, name: File(path!).path, documentTypeId: widget.documentType)); } if (widget.onChange != null) { widget.onChange!(widget.attachment); @@ -466,7 +469,7 @@ class _AttachmentPickerState extends State { if (pickedFile != null) { File fileImage = File(pickedFile.path); - widget.attachment.add(GenericAttachmentModel(id: 0, name: fileImage.path)); + widget.attachment.add(GenericAttachmentModel(id: 0, name: fileImage.path, documentTypeId: widget.documentType)); if (widget.onChange != null) { widget.onChange!(widget.attachment); } @@ -633,7 +636,7 @@ class _AttachmentPickerState extends State { if (pickedFile != null) { File fileImage = File(pickedFile.path); - widget.attachment.add(GenericAttachmentModel(id: 0, name: fileImage.path)); + widget.attachment.add(GenericAttachmentModel(id: 0, name: fileImage.path, documentTypeId: widget.documentType)); if (widget.onChange != null) { widget.onChange!(widget.attachment); } From cea77ff7f70f5c27834c7af72ad13e48caffb309 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Wed, 28 Jan 2026 12:13:44 +0300 Subject: [PATCH 2/4] evaluation form added. --- lib/controllers/api_routes/urls.dart | 40 +- lib/modules/demo_module/demo_provider.dart | 14 + .../demo_module/evaluation_form_page.dart | 350 ++++++++++++++++++ .../single_item_drop_down_menu.dart | 8 +- 4 files changed, 406 insertions(+), 6 deletions(-) create mode 100644 lib/modules/demo_module/evaluation_form_page.dart diff --git a/lib/controllers/api_routes/urls.dart b/lib/controllers/api_routes/urls.dart index e6c1f6e5..f1c4fbac 100644 --- a/lib/controllers/api_routes/urls.dart +++ b/lib/controllers/api_routes/urls.dart @@ -66,11 +66,15 @@ class URLs { //service request new flow urls. static get nurseDashboardCountUrl => '$_baseUrl/ServiceRequest/GetDashboardNurseCount'; + static get qaAuditorCount => '$_baseUrl/ServiceRequest/GetDashboardQAAuditorCount'; + static get commissioningEngineerCount => '$_baseUrl/ServiceRequest/GetDashboardCommissioningEngineerCount'; static get nurseDashboardDetailsUrl => '$_baseUrl/ServiceRequest/GetDashboardNurseDetails'; + static get qaAuditorDetails => '$_baseUrl/ServiceRequest/GetDashboardQAAuditorDetails'; + static get commissioningEngineerDetails => '$_baseUrl/ServiceRequest/GetDashboardCommissioningEngineerDetails'; static get nurseRejectUrl => '$_baseUrl/ServiceRequest/NurseReject'; @@ -246,7 +250,9 @@ class URLs { static get getTrafRequestTypeLookup => "$_baseUrl/Lookups/GetLookup?lookupEnum=416"; static get getYesNoRequestTypeLookup => "$_baseUrl/Lookups/GetLookup?lookupEnum=4"; + static get getDemoPeriodLookup => "$_baseUrl/Lookups/GetLookup?lookupEnum=4101"; + static get getDemoDocumentTypes => "$_baseUrl/Lookups/GetLookup?lookupEnum=4104"; static get getClassificationTypeLookup => "$_baseUrl/Lookups/GetLookup?lookupEnum=450"; @@ -398,6 +404,8 @@ class URLs { static get addLoan => '$_baseUrl/Loan/AddLoan'; + static get addDemoTrialOutcome => '$_baseUrl/DemoRequest/addDemoTrialOutcome'; + //Asset Delivery Module static get getAssetDeliveryDetailsById => '$_baseUrl/AssetDeliveryExternal/GetAssetDeliveryExternalById'; @@ -414,44 +422,70 @@ class URLs { static get getOracleUserList => '$_baseUrl/AssetDeliveryExternal/GetEmployeesFromOracle'; static get getLineFromExternalPo => '$_baseUrl/AssetDeliveryExternalDeliveryInspection/GetLineFromExternalPo'; + static get getCostCenterListToLineDeliveryInspection => '$_baseUrl/AssetDeliveryExternalDeliveryInspection/GetCostCenterToLineDeliveryInspection'; + static get getCostCenterAndSerialNoToLineDeliveryInspection => '$_baseUrl/AssetDeliveryExternalDeliveryInspection/GetCostCenterAndSerialNoToLineDeliveryInspection'; + static get getCostCenterToPo => '$_baseUrl/AssetDeliveryExternalDeliveryInspection/GetCostCenterToPo'; + static get saveCostCenterToLineDeliveryInspection => '$_baseUrl/AssetDeliveryExternalDeliveryInspection/SaveCostCenterToLineDeliveryInspection'; + static get saveCostCenterAndSerialNoToLineDeliveryInspection => '$_baseUrl/AssetDeliveryExternalDeliveryInspection/SaveCostCenterAndSerialNoToLineDeliveryInspection'; + static get getDeliveryHistories => '$_baseUrl/AssetDeliveryExternalDelivery/GetDeliveryHistories'; + //Technical Inscption... static get getLineFromTechnicalInspection => '$_baseUrl/AssetDeliveryExternalTechnicalInspection/GetLineFromDeliveryInspection'; + static get getTechnicalInspectionByDetailId => '$_baseUrl/AssetDeliveryExternalTechnicalInspection/GetTechnicalInspectionByDetailId'; + static get powerSupplyTypeLookUp => "$_baseUrl/Lookups/GetLookup?lookupEnum=527"; + static get saveTechnicalInspection => "$_baseUrl/AssetDeliveryExternalTechnicalInspection/SaveTechnicalInspection"; + static get getTechnicalInspectionParentData => "$_baseUrl/AssetDeliveryExternalTechnicalInspection/GetTechnicalInspectionItemByCostCenterId"; + static get getAssetFromInternalTechnicalInspection => "$_baseUrl/AssetDeliveryExternalTechnicalInspection/GetAssetFromInternal"; + static get getAssetDetailsByAssetId => "$_baseUrl/AssetDeliveryExternalTechnicalInspection/GetAssetByIdFromInternal"; + static get saveTechnicalInspectionAsset => "$_baseUrl/AssetDeliveryExternalTechnicalInspection/SaveTechnicalInspectionItem"; + static get getAttachments => "$_baseUrl/AssetDeliveryExternalDeliveryAttachment/GetAttachmentsBasedOnType"; + static get saveAttachments => "$_baseUrl/AssetDeliveryExternalDeliveryAttachment/Save"; + //End user Acceptance... static get getEndUserAcceptanceCostCenter => "$_baseUrl/AssetDeliveryEndUserAcceptance/GetEndUserAcceptanceCostCenter"; + static get getCostCenterAssetList => "$_baseUrl/AssetDeliveryEndUserAcceptance/GetItemByCostCenter"; + static get saveEndUserFormData => "$_baseUrl/AssetDeliveryEndUserAcceptance/SaveMaster"; + static get saveEndUserAssetData => "$_baseUrl/AssetDeliveryEndUserAcceptance/SaveDetail"; + static get endUserStatusLookup => "$_baseUrl/Lookups/GetLookup?lookupEnum=534"; + // static get endUserRejectionReasonLookup => "$_baseUrl/Lookups/GetLookup?lookupEnum=5007"; static get endUserRejectionReasonLookup => "$_baseUrl/Lookups/GetLookup?lookupEnum=415"; + static get attachmentTypeLookup => "$_baseUrl/Lookups/GetLookup?lookupEnum=5009"; //Medical Gas Request.. // 4004 static get orderTypeLookUp => "$_baseUrl/Lookups/GetLookup?lookupEnum=4004"; + // static get itemTypeLookUp => "$_baseUrl/Lookups/GetLookup?lookupEnum=4005"; static get itemTypeLookUp => "$_baseUrl/MedicalGas/GetItemTypeLookup?lookupEnum=4002"; + static get getMedicalGasSupplierList => "$_baseUrl/MedicalGas/GetMedicalGasSupplierAsync"; + static get getMedicalGasInfoBySupplier => "$_baseUrl/MedicalGas/GetMedicalGasInfoBySupplierAsync"; - static get addMedicalGasRequest => "$_baseUrl/MedicalGas/AddUpdateMedicalGasRequestAsync"; - static get getMedicalGasById => "$_baseUrl/MedicalGas/GetMedicalGasRequestByIdAsync"; - static get updateDeliveryNote => "$_baseUrl/MedicalGas/MedicalGasRequestDeliveryNotesAsync"; + static get addMedicalGasRequest => "$_baseUrl/MedicalGas/AddUpdateMedicalGasRequestAsync"; + static get getMedicalGasById => "$_baseUrl/MedicalGas/GetMedicalGasRequestByIdAsync"; + static get updateDeliveryNote => "$_baseUrl/MedicalGas/MedicalGasRequestDeliveryNotesAsync"; } diff --git a/lib/modules/demo_module/demo_provider.dart b/lib/modules/demo_module/demo_provider.dart index 18e64600..3d78c627 100644 --- a/lib/modules/demo_module/demo_provider.dart +++ b/lib/modules/demo_module/demo_provider.dart @@ -35,4 +35,18 @@ class DemoProvider extends ChangeNotifier { } return loanData; } + + Future addDemoTrialOutcome(Map body) async { + try { + Response response = await ApiManager.instance.post(URLs.addDemoTrialOutcome, body: body, showToast: false); + if (response.statusCode >= 200 && response.statusCode < 300) { + String message = (jsonDecode(response.body)["data"] ?? "") + " " + (jsonDecode(response.body)["message"] ?? ""); + Fluttertoast.showToast(msg: message ?? "", toastLength: Toast.LENGTH_LONG); + return true; + } + return false; + } catch (error) { + return false; + } + } } diff --git a/lib/modules/demo_module/evaluation_form_page.dart b/lib/modules/demo_module/evaluation_form_page.dart new file mode 100644 index 00000000..50904023 --- /dev/null +++ b/lib/modules/demo_module/evaluation_form_page.dart @@ -0,0 +1,350 @@ +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:test_sa/extensions/context_extension.dart'; +import 'package:test_sa/extensions/int_extensions.dart'; +import 'package:test_sa/extensions/string_extensions.dart'; +import 'package:test_sa/extensions/text_extensions.dart'; +import 'package:test_sa/extensions/widget_extensions.dart'; +import 'package:test_sa/helper/utils.dart'; +import 'package:test_sa/models/lookup.dart'; +import 'package:test_sa/modules/cm_module/views/components/action_button/footer_action_button.dart'; +import 'package:test_sa/modules/demo_module/demo_provider.dart'; +import 'package:test_sa/modules/loan_module/provider/loan_provider.dart'; +import 'package:test_sa/new_views/app_style/app_color.dart'; +import 'package:test_sa/new_views/common_widgets/app_filled_button.dart'; +import 'package:test_sa/new_views/common_widgets/app_text_form_field.dart'; +import 'package:test_sa/new_views/common_widgets/default_app_bar.dart'; +import 'package:test_sa/new_views/common_widgets/single_item_drop_down_menu.dart'; +import 'package:test_sa/providers/loading_list_notifier.dart'; + +class EvaluationFormPage extends StatefulWidget { + EvaluationFormPage({Key? key}) : super(key: key); + + @override + _EvaluationFormPageState createState() { + return _EvaluationFormPageState(); + } +} + +class _EvaluationFormPageState extends State { + final GlobalKey _formKey = GlobalKey(); + + bool isAcknowledged = false; + + static List rating = [ + Lookup(name: "1", id: 1, value: 1), + Lookup(name: "2", id: 2, value: 2), + Lookup(name: "3", id: 3, value: 3), + Lookup(name: "4", id: 4, value: 4), + Lookup(name: "5", id: 5, value: 5) + ]; + Map formData = {}; + + @override + void initState() { + super.initState(); + } + + @override + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: DefaultAppBar(title: 'Evaluation'.addTranslation), + body: Form( + key: _formKey, + child: Column( + children: [ + SingleChildScrollView( + padding: const EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + questionnaire(), + 16.height, + ratingQuestions(), + 16.height, + optionQuestions(), + ], + ), + ).expanded, + FooterActionButton.footerContainer( + context: context, + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Checkbox( + value: isAcknowledged, + visualDensity: const VisualDensity(horizontal: -4, vertical: -4), + activeColor: AppColor.blueStatus(context), + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + onChanged: (value) { + setState(() { + isAcknowledged = value!; + }); + }), + 8.width, + "I Acknowledge that the above information is correct and reflects my experience with the medical equipment." + .bodyText(context) + .custom(color: context.isDark ? AppColor.primary50 : AppColor.neutral120) + .expanded, + ], + ), + 16.height, + AppFilledButton( + buttonColor: AppColor.primary10, + label: context.translation.submitRequest, + disableButton: !isAcknowledged, + onPressed: _submit, + // buttonColor: AppColor.primary10, + ), + ], + ), + ), + ], + ), + ), + ); + } + + Widget questionnaire() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + 'Clinical practice after using the new technology'.addTranslation.bodyText(context).custom(color: AppColor.black10), + 16.height, + AppTextFormField( + initialValue: "", + hintText: "Some Comments", + labelText: "How did the new technology improve the practice compared with current technology", + validator: (value) { + if ((value ?? "").isEmpty) return "Mandatory"; + return null; + }, + style: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff3B3D4A)), + labelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff767676)), + floatingLabelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff3B3D4A)), + backgroundColor: AppColor.fieldBgColor(context), + showShadow: false, + textInputType: TextInputType.multiline, + makeMultiLinesNull: false, + onChange: (value) { + formData['practiceImprovementDescription'] = value; + }, + ), + 8.height, + AppTextFormField( + initialValue: "", + hintText: "Some Comments", + labelText: "Does it suit the clinical needs?", + validator: (value) { + if ((value ?? "").isEmpty) return "Mandatory"; + return null; + }, + style: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff3B3D4A)), + labelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff767676)), + floatingLabelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff3B3D4A)), + backgroundColor: AppColor.fieldBgColor(context), + showShadow: false, + textInputType: TextInputType.multiline, + makeMultiLinesNull: false, + onChange: (value) { + formData['suitsClinicalNeeds'] = value; + }, + ), + 8.height, + AppTextFormField( + initialValue: "", + labelText: "Did the technology save time?", + hintText: "Some Comments", + validator: (value) { + if ((value ?? "").isEmpty) return "Mandatory"; + return null; + }, + style: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff3B3D4A)), + labelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff767676)), + floatingLabelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff3B3D4A)), + backgroundColor: AppColor.fieldBgColor(context), + showShadow: false, + textInputType: TextInputType.multiline, + makeMultiLinesNull: false, + onChange: (value) { + formData['technologySavedTime'] = value; + }, + ), + ], + ).toShadowContainer(context, borderRadius: 20); + } + + Widget ratingQuestions() { + return Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ + 'Rating the following.'.addTranslation.bodyText(context).custom(color: AppColor.black10), + 16.height, + SingleItemDropDownMenu( + context: context, + title: "Ease of Use", + backgroundColor: AppColor.fieldBgColor(context), + showShadow: false, + showAsBottomSheet: true, + initialValue: formData['easeOfUse'], + staticData: rating, + validator: (value) { + if (value == null) return "Mandatory"; + return null; + }, + onSelect: (value) { + formData['easeOfUse'] = value; + }, + ), + 8.height, + SingleItemDropDownMenu( + context: context, + title: "Ease of Application", + backgroundColor: AppColor.fieldBgColor(context), + showShadow: false, + showAsBottomSheet: true, + initialValue: formData['easeOfApplication'], + staticData: rating, + validator: (value) { + if (value == null) return "Mandatory"; + return null; + }, + onSelect: (value) { + formData['easeOfApplication'] = value; + }, + ), + 8.height, + SingleItemDropDownMenu( + context: context, + title: "Ease to apply on patient & switch between patients", + backgroundColor: AppColor.fieldBgColor(context), + showShadow: false, + showAsBottomSheet: true, + initialValue: formData['easeOfPatientSwitch'], + staticData: rating, + validator: (value) { + if (value == null) return "Mandatory"; + return null; + }, + onSelect: (value) { + formData['easeOfPatientSwitch'] = value; + }, + ), + 8.height, + SingleItemDropDownMenu( + context: context, + title: "Patient Comfort", + backgroundColor: AppColor.fieldBgColor(context), + showShadow: false, + showAsBottomSheet: true, + initialValue: formData['patientComfort'], + staticData: rating, + validator: (value) { + if (value == null) return "Mandatory"; + return null; + }, + onSelect: (value) { + formData['patientComfort'] = value; + }, + ), + 8.height, + SingleItemDropDownMenu( + context: context, + title: "Patient Comfort", + backgroundColor: AppColor.fieldBgColor(context), + showShadow: false, + showAsBottomSheet: true, + initialValue: formData['patientComfort'], + staticData: rating, + validator: (value) { + if (value == null) return "Mandatory"; + return null; + }, + onSelect: (value) { + formData['patientComfort'] = value; + }, + ), + // 8.height, + // SingleItemDropDownMenu( + // context: context, + // title: "Overall Rating", + // backgroundColor: AppColor.fieldBgColor(context), + // showShadow: false, + // showAsBottomSheet: true, + // initialValue: formData['patientComfort'], + // staticData: rating, + // validator: (value) { + // if (value == null) return "Mandatory"; + // return null; + // }, + // onSelect: (value) { + // formData['patientComfort'] = value; + // }, + // ), + // 8.height, + // SingleItemDropDownMenu( + // context: context, + // title: "Equipment Overall Rate", + // backgroundColor: AppColor.fieldBgColor(context), + // showShadow: false, + // showAsBottomSheet: true, + // initialValue: formData['patientComfort'], + // staticData: rating, + // validator: (value) { + // if (value == null) return "Mandatory"; + // return null; + // }, + // onSelect: (value) { + // formData['patientComfort'] = value; + // }, + // ), + ]).toShadowContainer(context, borderRadius: 20); + } + + Widget optionQuestions() { + return Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ + 'Addition Information & Comments'.addTranslation.bodyText(context).custom(color: AppColor.black10), + 16.height, + AppTextFormField( + initialValue: "", + labelText: "Some Comments", + style: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff3B3D4A)), + labelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff767676)), + floatingLabelStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: context.isTablet() ? 16 : 12, color: context.isDark ? Colors.white : const Color(0xff3B3D4A)), + backgroundColor: AppColor.fieldBgColor(context), + showShadow: false, + textInputType: TextInputType.multiline, + makeMultiLinesNull: false, + onChange: (value) { + // _demoFormModel.docName = value; + }, + ), + ]).toShadowContainer(context, borderRadius: 20); + } + + Future _submit() async { + FocusScope.of(context).unfocus(); + if (_formKey.currentState!.validate()) { + _formKey.currentState!.save(); + Utils.showLoading(context); + DemoProvider demoProvider = Provider.of(context, listen: false); + formData["id"] = 0; + formData["isAcknowledged"] = isAcknowledged; + + bool isSuccess = await demoProvider.addDemoTrialOutcome(formData); + Utils.hideLoading(context); + if (isSuccess) { + Navigator.pop(context); + } + } + } +} diff --git a/lib/new_views/common_widgets/single_item_drop_down_menu.dart b/lib/new_views/common_widgets/single_item_drop_down_menu.dart index ce7f7838..0dfeda3d 100644 --- a/lib/new_views/common_widgets/single_item_drop_down_menu.dart +++ b/lib/new_views/common_widgets/single_item_drop_down_menu.dart @@ -205,9 +205,11 @@ class _SingleItemDropDownMenuState( value: _selectedItem, From 4e56746e88436622e44a08c89434f0b4dd99e534 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Wed, 28 Jan 2026 12:22:15 +0300 Subject: [PATCH 3/4] evaluation form added-1. --- .../demo_module/create_demo_request_page.dart | 2 ++ .../demo_module/evaluation_form_page.dart | 34 +++++++++---------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/lib/modules/demo_module/create_demo_request_page.dart b/lib/modules/demo_module/create_demo_request_page.dart index 79aec114..6c679609 100644 --- a/lib/modules/demo_module/create_demo_request_page.dart +++ b/lib/modules/demo_module/create_demo_request_page.dart @@ -116,6 +116,8 @@ class _CreateDemoRequestPageState extends State with Tick 16.height, ...vendorDetailsSection(), 16.height, + "Attachments".bodyText(context).custom(color: AppColor.black10), + 8.height, SingleItemDropDownMenu( context: context, height: 56.toScreenHeight, diff --git a/lib/modules/demo_module/evaluation_form_page.dart b/lib/modules/demo_module/evaluation_form_page.dart index 50904023..d0b627e1 100644 --- a/lib/modules/demo_module/evaluation_form_page.dart +++ b/lib/modules/demo_module/evaluation_form_page.dart @@ -256,23 +256,23 @@ class _EvaluationFormPageState extends State { formData['patientComfort'] = value; }, ), - 8.height, - SingleItemDropDownMenu( - context: context, - title: "Patient Comfort", - backgroundColor: AppColor.fieldBgColor(context), - showShadow: false, - showAsBottomSheet: true, - initialValue: formData['patientComfort'], - staticData: rating, - validator: (value) { - if (value == null) return "Mandatory"; - return null; - }, - onSelect: (value) { - formData['patientComfort'] = value; - }, - ), + // 8.height, + // SingleItemDropDownMenu( + // context: context, + // title: "Patient Comfort", + // backgroundColor: AppColor.fieldBgColor(context), + // showShadow: false, + // showAsBottomSheet: true, + // initialValue: formData['patientComfort'], + // staticData: rating, + // validator: (value) { + // if (value == null) return "Mandatory"; + // return null; + // }, + // onSelect: (value) { + // formData['patientComfort'] = value; + // }, + // ), // 8.height, // SingleItemDropDownMenu( // context: context, From c69bcc284355c174ca8889cd2fb9fee989ed5869 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Wed, 28 Jan 2026 12:42:11 +0300 Subject: [PATCH 4/4] improvement. --- lib/views/widgets/images/multi_image_picker.dart | 1 + lib/views/widgets/images/multi_image_picker_item.dart | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/views/widgets/images/multi_image_picker.dart b/lib/views/widgets/images/multi_image_picker.dart index 4278901f..aa9ecd79 100644 --- a/lib/views/widgets/images/multi_image_picker.dart +++ b/lib/views/widgets/images/multi_image_picker.dart @@ -373,6 +373,7 @@ class _AttachmentPickerState extends State { file: image, showAsListView: widget.showAsListView, enabled: widget.enabled, + documentType: widget.attachment[index].documentTypeId?.name, onRemoveTap: (image) { if (!widget.enabled) { return; diff --git a/lib/views/widgets/images/multi_image_picker_item.dart b/lib/views/widgets/images/multi_image_picker_item.dart index 662e7e4e..b889b547 100644 --- a/lib/views/widgets/images/multi_image_picker_item.dart +++ b/lib/views/widgets/images/multi_image_picker_item.dart @@ -21,6 +21,7 @@ class MultiFilesPickerItem extends StatelessWidget { final Function(File) onRemoveTap; final VoidCallback? onRemove; final bool showAsListView; + final String? documentType; const MultiFilesPickerItem({ Key? key, @@ -28,6 +29,7 @@ class MultiFilesPickerItem extends StatelessWidget { required this.enabled, required this.onRemoveTap, this.onRemove, + this.documentType, this.showAsListView = false, }) : super(key: key); @@ -82,7 +84,7 @@ class MultiFilesPickerItem extends StatelessWidget { 4.height, RichText( text: TextSpan( - text: 'Asset Guide | ', + text: documentType == null ? 'Asset Guide | ' : '$documentType | ', style: AppTextStyles.bodyText.copyWith(color: AppColor.neutral120), children: [ TextSpan(