From a0a084803d658c0c48192f7a5dc2ce3e44b30bb1 Mon Sep 17 00:00:00 2001 From: WaseemAbbasi22 Date: Tue, 20 Jan 2026 10:01:46 +0300 Subject: [PATCH] UI improvements --- lib/extensions/enum_extensions.dart | 24 + lib/models/lookup.dart | 6 +- .../helper_function.dart | 3 +- .../models/asset_delivery_data_model.dart | 1 + .../pages/asset_delivery_page.dart | 48 +- .../pages/asset_delivery_stage_tab_page.dart | 90 ++++ .../pages/asset_delivery_table_card_view.dart | 47 +- .../pages/attachment_view.dart | 6 +- .../delivery_inspection_form_view.dart | 65 ++- .../end_user_cost_center_list_view.dart | 20 +- .../update_end_user_asset_details_view.dart | 1 - .../pages/history_log_view.dart | 12 +- .../status_checklist_view.dart | 216 ++++++--- .../technical_inspection_lines_list_view.dart | 43 +- .../update_child_asset_view.dart | 9 +- .../update_parent_asset_view.dart | 454 +----------------- 16 files changed, 444 insertions(+), 601 deletions(-) create mode 100644 lib/modules/asset_delivery_module/pages/asset_delivery_stage_tab_page.dart diff --git a/lib/extensions/enum_extensions.dart b/lib/extensions/enum_extensions.dart index 991a0f81..24d0a479 100644 --- a/lib/extensions/enum_extensions.dart +++ b/lib/extensions/enum_extensions.dart @@ -121,6 +121,24 @@ extension StringExtensionsRecurrentTaskInpesctionDataType on String { } } } + + +extension IntExtensionsAssetDeliveryStage on int { + AssetDeliveryStageEnum toAssetDeliveryStageEnum() { + switch (this) { + case 2: + return AssetDeliveryStageEnum.deliveryInspection; + case 3: + return AssetDeliveryStageEnum.technicalInspection; + case 4: + return AssetDeliveryStageEnum.endUserAcceptance; + default: + return AssetDeliveryStageEnum.other; + } + } +} + + enum DropDownMatchType { identifier, name, @@ -131,3 +149,9 @@ enum CostCenterType { costCenter, serialNumber, } +enum AssetDeliveryStageEnum { + deliveryInspection, + technicalInspection, + endUserAcceptance, + other, +} diff --git a/lib/models/lookup.dart b/lib/models/lookup.dart index 844e46df..1af16028 100644 --- a/lib/models/lookup.dart +++ b/lib/models/lookup.dart @@ -7,9 +7,10 @@ class Lookup extends Base { int? id; // Now nullable int? value; // Now nullable WorkOrderNextStepEnum? workOrderNextStepEnum; // Now nullable + AssetDeliveryStageEnum? assetDeliveryStageEnum; // Now nullable String? name; // Now nullable - Lookup({this.id, this.value, this.name, this.workOrderNextStepEnum}) : super(identifier: id?.toString(), name: name); + Lookup({this.id, this.value, this.name, this.workOrderNextStepEnum, this.assetDeliveryStageEnum}) : super(identifier: id?.toString(), name: name); @override bool operator ==(Object other) => identical(this, other) || other is Lookup && ((value != null && value == other.value) || (id != null && id == other.id)); @@ -38,10 +39,11 @@ class Lookup extends Base { // } factory Lookup.fromJson(Map? parsedJson) { - if(parsedJson==null) return Lookup(); + if (parsedJson == null) return Lookup(); return Lookup( name: parsedJson["name"], workOrderNextStepEnum: parsedJson["value"] == null ? null : (parsedJson["value"] as int).toWorkOrderNextStepEnum(), + assetDeliveryStageEnum: parsedJson["value"] == null ? null : (parsedJson["value"] as int).toAssetDeliveryStageEnum(), id: parsedJson["id"], value: parsedJson["value"], ); diff --git a/lib/modules/asset_delivery_module/helper_function.dart b/lib/modules/asset_delivery_module/helper_function.dart index b34a749c..0cfb122e 100644 --- a/lib/modules/asset_delivery_module/helper_function.dart +++ b/lib/modules/asset_delivery_module/helper_function.dart @@ -10,7 +10,7 @@ import 'package:test_sa/new_views/common_widgets/single_item_drop_down_menu.dart import 'package:test_sa/views/widgets/loaders/no_data_found.dart'; class HelperFunction { - static void attachmentTap({required BuildContext context, required AssetDeliveryProvider assetDeliveryProvider, required dynamic deliveryTableItemId}) async { + static void attachmentTap({required BuildContext context, bool viewOnly = false, required AssetDeliveryProvider assetDeliveryProvider, required dynamic deliveryTableItemId}) async { Lookup? result; result = await showAttachmentTypeBottomSheet(context); List list = []; @@ -30,6 +30,7 @@ class HelperFunction { builder: (context) => AssetDeliveryAttachmentView( tableItemId: deliveryTableItemId, attachmentType: result!.value, + viewOnly: viewOnly, attachmentList: list, ))); // } diff --git a/lib/modules/asset_delivery_module/models/asset_delivery_data_model.dart b/lib/modules/asset_delivery_module/models/asset_delivery_data_model.dart index cde76346..15ece8ca 100644 --- a/lib/modules/asset_delivery_module/models/asset_delivery_data_model.dart +++ b/lib/modules/asset_delivery_module/models/asset_delivery_data_model.dart @@ -305,6 +305,7 @@ class AssetDeliveryTableModel { status = json['status'] != null ? Lookup.fromJson(json['status']) : null; + } Map toJson() { diff --git a/lib/modules/asset_delivery_module/pages/asset_delivery_page.dart b/lib/modules/asset_delivery_module/pages/asset_delivery_page.dart index b3a3174b..a4ce0983 100644 --- a/lib/modules/asset_delivery_module/pages/asset_delivery_page.dart +++ b/lib/modules/asset_delivery_module/pages/asset_delivery_page.dart @@ -6,6 +6,7 @@ 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/modules/asset_delivery_module/models/asset_delivery_data_model.dart'; +import 'package:test_sa/modules/asset_delivery_module/pages/asset_delivery_stage_tab_page.dart'; import 'package:test_sa/modules/asset_delivery_module/pages/asset_delivery_table_card_view.dart'; import 'package:test_sa/modules/asset_delivery_module/pages/change_status_bottomsheet.dart'; import 'package:test_sa/modules/asset_delivery_module/pages/delivery_inspection/delivery_inspection_form_view.dart'; @@ -35,6 +36,7 @@ class AssetDeliveryPage extends StatefulWidget { class _AssetDeliveryPageState extends State { AssetDeliveryDataModel? dataModel; AssetDeliveryProvider? assetDeliveryProvider; + bool loading = false; @override void initState() { @@ -46,12 +48,18 @@ class _AssetDeliveryPageState extends State { } Future getDetailsById() async { + setState(() { + loading = true; + }); final futures = [ assetDeliveryProvider!.getAssetDeliveryDetailById(requestId: widget.requestId).then((value) => dataModel = value), assetDeliveryProvider!.getAssetDeliveryTableListById(requestId: widget.requestId), ]; await Future.wait(futures); + setState(() { + loading = false; + }); } @override @@ -68,7 +76,7 @@ class _AssetDeliveryPageState extends State { body: Consumer( builder: (context, provider, child) { final dataModel = provider.assetDeliveryDataModel; - if (provider.isLoading) { + if (loading) { return const CircularProgressIndicator(color: AppColor.primary10).center; } if (dataModel == null) { @@ -246,16 +254,17 @@ class _AssetDeliveryPageState extends State { style: AppTextStyles.bodyText2.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral120), ), 8.height, - Text( - 'EDD (Estimated Delivery Date)'.addTranslation, - style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.black10), - ), - 8.height, - Text( - dataModel?.edd != null ? dataModel!.edd!.toAssetDetailsFormat : '-', - style: AppTextStyles.bodyText2.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral120), - ), - 8.height, + //Removed as request by Ahmed backend... + // Text( + // 'EDD (Estimated Delivery Date)'.addTranslation, + // style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.black10), + // ), + // 8.height, + // Text( + // dataModel?.edd != null ? dataModel!.edd!.toAssetDetailsFormat : '-', + // style: AppTextStyles.bodyText2.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral120), + // ), + // 8.height, Text( 'Total'.addTranslation, style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.black10), @@ -321,10 +330,21 @@ class _AssetDeliveryPageState extends State { }); }); } else { + // Navigator.of(context).push(MaterialPageRoute( + // builder: (_) => + // DeliveryInspectionFormView( + // deliveryTableModel: model, + // requestModel: dataModel, + // ), + // )); Navigator.of(context).push(MaterialPageRoute( - builder: (_) => DeliveryInspectionFormView( - deliveryTableModel: model, - requestModel: dataModel, + builder: (_) => AssetDeliveryStageTabPage( + title: 'Delivery Inspection'.addTranslation, + detailWidget: DeliveryInspectionFormView( + deliveryTableModel: model, + requestModel: dataModel, + ), + tableId: model.id, ), )); } diff --git a/lib/modules/asset_delivery_module/pages/asset_delivery_stage_tab_page.dart b/lib/modules/asset_delivery_module/pages/asset_delivery_stage_tab_page.dart new file mode 100644 index 00000000..959beffc --- /dev/null +++ b/lib/modules/asset_delivery_module/pages/asset_delivery_stage_tab_page.dart @@ -0,0 +1,90 @@ +import 'package:flutter/material.dart'; +import 'package:test_sa/extensions/context_extension.dart'; +import 'package:test_sa/extensions/enum_extensions.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/modules/asset_delivery_module/pages/history_log_view.dart'; +import 'package:test_sa/new_views/app_style/app_color.dart'; +import 'package:test_sa/new_views/common_widgets/default_app_bar.dart'; + +class AssetDeliveryStageTabPage extends StatefulWidget { + String title; + Widget detailWidget; + int? tableId; + + AssetDeliveryStageTabPage({ + Key? key, + required this.title, + required this.detailWidget, + this.tableId, + }) : super(key: key); + + @override + _AssetDeliveryStageTabPageState createState() { + return _AssetDeliveryStageTabPageState(); + } +} + +class _AssetDeliveryStageTabPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + appBar: DefaultAppBar( + title: widget.title, + ), + body: DefaultTabController( + length: 2, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + margin: EdgeInsets.only(left: 16.toScreenWidth, right: 16.toScreenWidth, top: 12.toScreenHeight), + decoration: BoxDecoration(color: context.isDark ? AppColor.neutral50 : AppColor.white10, borderRadius: BorderRadius.circular(10)), + child: TabBar( + padding: EdgeInsets.symmetric(vertical: 4.toScreenHeight, horizontal: 4.toScreenWidth), + labelColor: context.isDark ? AppColor.neutral30 : AppColor.black20, + unselectedLabelColor: context.isDark ? AppColor.neutral30 : AppColor.black20, + unselectedLabelStyle: AppTextStyles.bodyText, + labelStyle: AppTextStyles.bodyText, + indicatorPadding: EdgeInsets.zero, + indicatorSize: TabBarIndicatorSize.tab, + dividerColor: Colors.transparent, + indicator: BoxDecoration(color: context.isDark ? AppColor.neutral60 : AppColor.neutral110, borderRadius: BorderRadius.circular(7)), + tabs: [ + Tab(text: context.translation.details, height: 57.toScreenHeight), + Tab(text: context.translation.historyLogs, height: 57.toScreenHeight), + ], + ), + ), + // 12.height, + TabBarView( + children: [ + widget.detailWidget, + AssetDeliveryHistoryLogView( + tableItemId: widget.tableId, + ), + ], + ).expanded, + ], + ), + )); + } + + + String getPageTitle({AssetDeliveryStageEnum? deliveryStage}) { + if (deliveryStage == AssetDeliveryStageEnum.deliveryInspection) { + return 'Delivery Inspection'.addTranslation; + } + if (deliveryStage == AssetDeliveryStageEnum.technicalInspection) { + return 'Technical Inspection'.addTranslation; + } + if (deliveryStage == AssetDeliveryStageEnum.endUserAcceptance) { + return 'End-User Acceptance'.addTranslation; + } else { + return 'Details'.addTranslation; + } + } +} diff --git a/lib/modules/asset_delivery_module/pages/asset_delivery_table_card_view.dart b/lib/modules/asset_delivery_module/pages/asset_delivery_table_card_view.dart index 0d906d49..e7a41d96 100644 --- a/lib/modules/asset_delivery_module/pages/asset_delivery_table_card_view.dart +++ b/lib/modules/asset_delivery_module/pages/asset_delivery_table_card_view.dart @@ -26,28 +26,33 @@ class AssetDeliveryTableCard extends StatelessWidget { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - StatusLabel( - label: deliveryTableModel.status?.name, - textColor: AppColor.neutral50, - backgroundColor: AppColor.orange30, - ), - Row( - children: [ - 'history_icon'.toSvgAsset(height: 14, width: 14), - 8.width, - Text( - 'View History'.addTranslation, - style: AppTextStyles.bodyText.copyWith(color: AppColor.primary10), - ), - ], - ).onPress(() { - onViewHistoryTap(); - }), - ], + StatusLabel( + label: deliveryTableModel.status?.name, + textColor: AppColor.neutral50, + backgroundColor: AppColor.orange30, ), + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // StatusLabel( + // label: deliveryTableModel.status?.name, + // textColor: AppColor.neutral50, + // backgroundColor: AppColor.orange30, + // ), + // Row( + // children: [ + // 'history_icon'.toSvgAsset(height: 14, width: 14), + // 8.width, + // Text( + // 'View History'.addTranslation, + // style: AppTextStyles.bodyText.copyWith(color: AppColor.primary10), + // ), + // ], + // ).onPress(() { + // onViewHistoryTap(); + // }), + // ], + // ), 8.height, Text( 'Delivery Number: ${deliveryTableModel.number ?? '-'}', diff --git a/lib/modules/asset_delivery_module/pages/attachment_view.dart b/lib/modules/asset_delivery_module/pages/attachment_view.dart index e98ab0af..2f4020e7 100644 --- a/lib/modules/asset_delivery_module/pages/attachment_view.dart +++ b/lib/modules/asset_delivery_module/pages/attachment_view.dart @@ -24,11 +24,13 @@ import 'package:test_sa/views/widgets/loaders/no_data_found.dart'; class AssetDeliveryAttachmentView extends StatefulWidget { final int? tableItemId; final int? attachmentType; + bool viewOnly = false; final List attachmentList; - const AssetDeliveryAttachmentView({ + AssetDeliveryAttachmentView({ super.key, required this.attachmentList, + this.viewOnly=false, this.attachmentType, this.tableItemId, }); @@ -80,7 +82,7 @@ class _AssetDeliveryAttachmentViewState extends State Widget build(BuildContext context) { return Scaffold( backgroundColor: Theme.of(context).scaffoldBackgroundColor, - appBar: DefaultAppBar( - title: 'Delivery Inspection'.addTranslation, - onBackPress: () { - Navigator.pop(context); - }, - ), + // appBar: DefaultAppBar( + // title: 'Delivery Inspection'.addTranslation, + // onBackPress: () { + // Navigator.pop(context); + // }, + // ), body: isLoading ? const CircularProgressIndicator(color: AppColor.primary10).center : Form( @@ -164,7 +167,20 @@ class _DeliveryInspectionFormViewState extends State ), ], ) - : AppFilledButton(buttonColor: AppColor.primary10, label: 'Next'.addTranslation, maxWidth: true, onPressed: _nextTap), + : Row( + children: [ + AppFilledButton( + buttonColor: AppColor.white60, + label: 'Attachments'.addTranslation, + maxWidth: true, + textColor: AppColor.black10, + onPressed: () { + HelperFunction.attachmentTap(context: context, viewOnly: true, assetDeliveryProvider: assetDeliveryProvider!, deliveryTableItemId: widget.deliveryTableModel.id); + }).expanded, + 8.width, + AppFilledButton(buttonColor: AppColor.primary10, label: 'Next'.addTranslation, maxWidth: true, onPressed: _nextTap).expanded, + ], + ), ), ], ), @@ -618,21 +634,44 @@ class _DeliveryInspectionFormViewState extends State void _nextTap() { if (widget.deliveryTableModel.isContainsTechnicalInspection == true) { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => TechnicalInspectionLinesListView( + // deliveryTableModel: widget.deliveryTableModel, + // requestModel: widget.requestModel, + // )) + // ); Navigator.push( context, MaterialPageRoute( - builder: (context) => TechnicalInspectionLinesListView( - deliveryTableModel: widget.deliveryTableModel, - requestModel: widget.requestModel, + builder: (context) => AssetDeliveryStageTabPage( + title: 'Technical Inspection'.addTranslation, + detailWidget: TechnicalInspectionLinesListView( + deliveryTableModel: widget.deliveryTableModel, + requestModel: widget.requestModel, + ), + tableId: widget.deliveryTableModel.id, ))); } else { Navigator.push( context, MaterialPageRoute( - builder: (context) => EndUserCostCenterLIstView( - deliveryTableModel: widget.deliveryTableModel, - requestModel: widget.requestModel, + builder: (context) => AssetDeliveryStageTabPage( + title: 'End-User Acceptance'.addTranslation, + detailWidget: EndUserCostCenterLIstView( + deliveryTableModel: widget.deliveryTableModel, + requestModel: widget.requestModel, + ), + tableId: widget.deliveryTableModel.id, ))); + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => EndUserCostCenterLIstView( + // deliveryTableModel: widget.deliveryTableModel, + // requestModel: widget.requestModel, + // ))); } } diff --git a/lib/modules/asset_delivery_module/pages/end_user_acceptance/end_user_cost_center_list_view.dart b/lib/modules/asset_delivery_module/pages/end_user_acceptance/end_user_cost_center_list_view.dart index 92979620..f032d75a 100644 --- a/lib/modules/asset_delivery_module/pages/end_user_acceptance/end_user_cost_center_list_view.dart +++ b/lib/modules/asset_delivery_module/pages/end_user_acceptance/end_user_cost_center_list_view.dart @@ -72,10 +72,10 @@ class _EndUserCostCenterLIstViewState extends State { Widget build(BuildContext context) { return Scaffold( key: _scaffoldKey, - appBar: DefaultAppBar( - title: 'End-User Acceptance'.addTranslation, - titleStyle: AppTextStyles.heading3.copyWith(fontWeight: FontWeight.w500, color: context.isDark ? AppColor.neutral30 : AppColor.neutral50), - ), + // appBar: DefaultAppBar( + // title: 'End-User Acceptance'.addTranslation, + // titleStyle: AppTextStyles.heading3.copyWith(fontWeight: FontWeight.w500, color: context.isDark ? AppColor.neutral30 : AppColor.neutral50), + // ), body: Form( key: _formKey, child: isLoading @@ -108,7 +108,17 @@ class _EndUserCostCenterLIstViewState extends State { ), ], )) - : const SizedBox(), + : FooterActionButton.footerContainer( + context: context, + child: AppFilledButton( + buttonColor: AppColor.white60, + label: 'Attachments'.addTranslation, + maxWidth: true, + textColor: AppColor.black10, + onPressed: () { + HelperFunction.attachmentTap(context: context, viewOnly: true, assetDeliveryProvider: assetDeliveryProvider!, deliveryTableItemId: widget.deliveryTableModel.id); + }), + ), ], ), ), diff --git a/lib/modules/asset_delivery_module/pages/end_user_acceptance/update_end_user_asset_details_view.dart b/lib/modules/asset_delivery_module/pages/end_user_acceptance/update_end_user_asset_details_view.dart index ecccc451..834b96b3 100644 --- a/lib/modules/asset_delivery_module/pages/end_user_acceptance/update_end_user_asset_details_view.dart +++ b/lib/modules/asset_delivery_module/pages/end_user_acceptance/update_end_user_asset_details_view.dart @@ -292,7 +292,6 @@ class _UpdateEndUserAssetDetailsViewState extends State(builder: (context, provider, _) { return provider.isLoading ? const CircularProgressIndicator(color: AppColor.primary10).center diff --git a/lib/modules/asset_delivery_module/pages/technical_inpection/status_checklist_view.dart b/lib/modules/asset_delivery_module/pages/technical_inpection/status_checklist_view.dart index 9a574d69..e98c1213 100644 --- a/lib/modules/asset_delivery_module/pages/technical_inpection/status_checklist_view.dart +++ b/lib/modules/asset_delivery_module/pages/technical_inpection/status_checklist_view.dart @@ -13,34 +13,27 @@ 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/default_app_bar.dart'; -class InspectionChecklistBottomSheet extends StatefulWidget { +class InspectionCheckListView extends StatefulWidget { final List? initialValues; - const InspectionChecklistBottomSheet({super.key, this.initialValues}); + const InspectionCheckListView({super.key, this.initialValues}); @override - State createState() => - _InspectionChecklistBottomSheetState(); + State createState() => _InspectionCheckListViewState(); } -class _InspectionChecklistBottomSheetState - extends State { +class _InspectionCheckListViewState extends State { late List checklist; @override void initState() { super.initState(); + checklist = AssetDeliveryUtils.inspectionChecklist.map((e) => InspectionChecklistItem(title: e.title)).toList(); - /// Create local copy (no shared mutation) - checklist = AssetDeliveryUtils.inspectionChecklist - .map((e) => InspectionChecklistItem(title: e.title)) - .toList(); - - /// Apply initial values only if provided if (widget.initialValues != null && widget.initialValues!.isNotEmpty) { for (final item in checklist) { final matched = widget.initialValues!.firstWhere( - (e) => e.title == item.title, + (e) => e.title == item.title, orElse: () => InspectionChecklistItem(), ); item.status = matched.status; // null-safe @@ -54,70 +47,36 @@ class _InspectionChecklistBottomSheetState }); } - List get selectedValues => - checklist.where((e) => e.status != null).toList(); + List get selectedValues => checklist.where((e) => e.status != null).toList(); @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: AppColor.white10, appBar: DefaultAppBar( title: 'Asset Check List'.addTranslation, - showBackButton: false, - titleStyle: AppTextStyles.heading3.copyWith( - fontWeight: FontWeight.w500, - color: context.isDark - ? AppColor.neutral30 - : AppColor.neutral50, - ), ), body: Column( children: [ - 12.height, - ListView.builder( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemCount: checklist.length, - padding: const EdgeInsets.symmetric(horizontal: 12), - itemBuilder: (context, index) { - final item = checklist[index]; - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - item.title ?? '', - style: AppTextStyles.heading6.copyWith( - color: context.isDark - ? AppColor.neutral30 - : AppColor.black10, - ), - ), - Row( - children: [ - Expanded( - child: RadioListTile( - title: const Text('Pass'), - value: 'PASS', - groupValue: item.status, - onChanged: (v) => - updateStatus(index, v!), - ), - ), - Expanded( - child: RadioListTile( - title: const Text('Fail'), - value: 'FAIL', - groupValue: item.status, - onChanged: (v) => - updateStatus(index, v!), - ), - ), - ], - ), - ], - ); - }, - ).expanded, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: List.generate( + checklist.length, + (index) { + final model = checklist[index]; + return inspectionStatusRadioWidget( + model: model, + index: index, + context: context, + ); + }, + ), + ).toShadowContainer( + context, + borderRadius: 20, + margin: const EdgeInsets.only(top: 12, left: 12, right: 12), + ), + const Spacer(), FooterActionButton.footerContainer( context: context, child: AppFilledButton( @@ -133,5 +92,124 @@ class _InspectionChecklistBottomSheetState ), ); } -} + Widget inspectionStatusRadioWidget({required int index, required InspectionChecklistItem model, required BuildContext context}) { + bool status = (model.status == null || model.status == null) ? true : (model.status != null ? (model.status == 'true' ? true : false) : false); + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + model.title ?? '', + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: AppTextStyles.bodyText.copyWith(color: context.isDark ? Colors.white : AppColor.white936), + ), + 14.height, + // Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // + // (status ? 'Pass' : 'Fail').bodyText2(context).custom(color: AppColor.neutral120, fontWeight: FontWeight.w500), + // ], + // ).expanded, + GestureDetector( + onTap: () { + setState(() { + status = !status; + model.status = status.toString(); + }); + }, + child: Container( + width: 99.toScreenWidth, + height: 40.toScreenHeight, + padding: EdgeInsetsDirectional.all(4.toScreenHeight), + decoration: BoxDecoration( + color: AppColor.fieldBgColor(context), + borderRadius: BorderRadius.circular(5), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + buildToggleOption( + label: "PASS", + isActive: status, + activeColor: AppColor.green20, + inactiveColor: Colors.transparent, + textColor: status + ? AppColor.green50 + : context.isDark + ? Colors.white + : AppColor.black20, + ), + buildToggleOption( + label: "FAIL", + isActive: !status, + activeColor: AppColor.red20, + inactiveColor: Colors.transparent, + textColor: status + ? context.isDark + ? Colors.white + : AppColor.black20 + : AppColor.red30, + ), + ], + ), + ), + ), + ], + ).paddingOnly(top: 4, bottom: 4); + } + + Widget buildToggleOption({ + required String label, + required bool isActive, + required Color activeColor, + required Color inactiveColor, + required Color textColor, + }) { + return Container( + width: 44.toScreenWidth, + height: 30.toScreenHeight, + alignment: Alignment.center, + decoration: BoxDecoration( + color: isActive ? activeColor : inactiveColor, + borderRadius: BorderRadius.circular(3), + ), + child: label.bodyText2(context).custom(color: textColor), + ); + } + +//older widget ... +// return Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Text( +// item.title ?? '', +// style: AppTextStyles.heading6.copyWith( +// color: context.isDark ? AppColor.neutral30 : AppColor.black10, +// ), +// ), +// Row( +// children: [ +// Expanded( +// child: RadioListTile( +// title: const Text('Pass'), +// value: 'PASS', +// groupValue: item.status, +// onChanged: (v) => updateStatus(index, v!), +// ), +// ), +// Expanded( +// child: RadioListTile( +// title: const Text('Fail'), +// value: 'FAIL', +// groupValue: item.status, +// onChanged: (v) => updateStatus(index, v!), +// ), +// ), +// ], +// ), +// ], +// ); +} diff --git a/lib/modules/asset_delivery_module/pages/technical_inpection/technical_inspection_lines_list_view.dart b/lib/modules/asset_delivery_module/pages/technical_inpection/technical_inspection_lines_list_view.dart index b4c6d505..e2c05093 100644 --- a/lib/modules/asset_delivery_module/pages/technical_inpection/technical_inspection_lines_list_view.dart +++ b/lib/modules/asset_delivery_module/pages/technical_inpection/technical_inspection_lines_list_view.dart @@ -12,6 +12,7 @@ import 'package:test_sa/modules/asset_delivery_module/helper_function.dart'; import 'package:test_sa/modules/asset_delivery_module/models/asset_delivery_data_model.dart'; import 'package:test_sa/modules/asset_delivery_module/models/delivery_line_model.dart'; import 'package:test_sa/modules/asset_delivery_module/pages/asset_delivery_line_card_view.dart'; +import 'package:test_sa/modules/asset_delivery_module/pages/asset_delivery_stage_tab_page.dart'; import 'package:test_sa/modules/asset_delivery_module/pages/attachment_view.dart'; import 'package:test_sa/modules/asset_delivery_module/pages/end_user_acceptance/end_user_cost_center_list_view.dart'; import 'package:test_sa/modules/asset_delivery_module/pages/technical_inpection/update_technical_inspection_lines_view.dart'; @@ -79,10 +80,10 @@ class _TechnicalInspectionLinesListViewState extends State EndUserCostCenterLIstView( + // requestModel: widget.requestModel, + // deliveryTableModel: widget.deliveryTableModel, + // ))); + Navigator.push( context, MaterialPageRoute( - builder: (context) => EndUserCostCenterLIstView( - requestModel: widget.requestModel, - deliveryTableModel: widget.deliveryTableModel, + builder: (context) => AssetDeliveryStageTabPage( + title: 'End-User Acceptance'.addTranslation, + detailWidget: EndUserCostCenterLIstView( + deliveryTableModel: widget.deliveryTableModel, + requestModel: widget.requestModel, + ), + tableId: widget.deliveryTableModel.id, ))); } } diff --git a/lib/modules/asset_delivery_module/pages/technical_inpection/update_child_asset_view.dart b/lib/modules/asset_delivery_module/pages/technical_inpection/update_child_asset_view.dart index 07c7450d..3e151cb9 100644 --- a/lib/modules/asset_delivery_module/pages/technical_inpection/update_child_asset_view.dart +++ b/lib/modules/asset_delivery_module/pages/technical_inpection/update_child_asset_view.dart @@ -25,8 +25,6 @@ import '../../../../models/new_models/department.dart'; import '../../../../new_views/common_widgets/app_filled_button.dart'; import '../../../../new_views/common_widgets/default_app_bar.dart'; -//TODO need to refactor this screen when done ... - class UpdateChildAssetView extends StatefulWidget { final TechnicalInspectionAssetModel assetModel; final int? lineId; @@ -183,7 +181,6 @@ class _UpdateChildAssetViewState extends State { await provider.getSiteData(siteId: assetModel.site?.id, model: provider.childFormModel); } provider.setParentModel(assetModel); - log('child list length ${assetModel.childAssetList?.length}'); populateTextFields(model: provider.childFormModel); } } @@ -383,8 +380,8 @@ class _UpdateChildAssetViewState extends State { ///Need to check which details show here... void _saveTap() async { - if(!_formKey.currentState!.validate()) return; - if(assetDeliveryProvider.childFormModel.installationDate==null){ + if (!_formKey.currentState!.validate()) return; + if (assetDeliveryProvider.childFormModel.installationDate == null) { "Installation Date is Required".showToast; return; } @@ -401,7 +398,7 @@ class _UpdateChildAssetViewState extends State { final result = await Navigator.push( context, MaterialPageRoute( - builder: (context) => InspectionChecklistBottomSheet( + builder: (context) => InspectionCheckListView( initialValues: checkList, ))); if (result != null) { diff --git a/lib/modules/asset_delivery_module/pages/technical_inpection/update_parent_asset_view.dart b/lib/modules/asset_delivery_module/pages/technical_inpection/update_parent_asset_view.dart index 14944824..ceafcfe6 100644 --- a/lib/modules/asset_delivery_module/pages/technical_inpection/update_parent_asset_view.dart +++ b/lib/modules/asset_delivery_module/pages/technical_inpection/update_parent_asset_view.dart @@ -28,8 +28,6 @@ import '../../../../models/new_models/department.dart'; import '../../../../new_views/common_widgets/app_filled_button.dart'; import '../../../../new_views/common_widgets/default_app_bar.dart'; -//TODO need to refactor this screen also add loaders when done ... - class UpdateParentAssetView extends StatefulWidget { final TechnicalInspectionAssetModel assetModel; final int? lineId; @@ -438,7 +436,6 @@ class _UpdateParentAssetViewState extends State { assetDeliveryProvider.parentFormModel.tableItemId = widget.tableItemId; assetDeliveryProvider.parentFormModel.costCenterId = widget.costCenterItemId; - log('model data ${assetDeliveryProvider.parentFormModel.toJson()}'); showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading()); await assetDeliveryProvider.saveTechnicalInspectionAssetData(model: assetDeliveryProvider.parentFormModel).then((status) async { Navigator.pop(context); @@ -453,7 +450,7 @@ class _UpdateParentAssetViewState extends State { final result = await Navigator.push( context, MaterialPageRoute( - builder: (context) => InspectionChecklistBottomSheet( + builder: (context) => InspectionCheckListView( initialValues: checkList, ))); @@ -462,18 +459,6 @@ class _UpdateParentAssetViewState extends State { setState(() {}); } buildInspectionPayload(checkList); - if (checkList.isNotEmpty) { - final isPass = checkList.every((e) => e.status == 'PASS'); - log('Final Status: ${isPass ? 'PASS' : 'FAIL'}'); - } - -// call this as bottomsheet. - // final result = await showModalBottomSheet>>( - // context: context, - // isScrollControlled: true, - // backgroundColor: Colors.transparent, - // builder: (_) => const InspectionChecklistBottomSheet(), - // ); } bool _isPass(List list, String title) { @@ -528,446 +513,9 @@ class _UpdateParentAssetViewState extends State { break; } } - checkList.forEach((item) { - log('items ${item.toJson()}'); - }); } String _statusFromBool(bool? value) { return value == true ? 'PASS' : 'FAIL'; } } - -// import 'dart:developer'; -// 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/models/new_models/building.dart'; -// import 'package:test_sa/models/new_models/floor.dart'; -// import 'package:test_sa/models/new_models/site.dart'; -// import 'package:test_sa/modules/asset_delivery_module/models/technical_inspection_asset_model.dart'; -// import 'package:test_sa/modules/asset_delivery_module/pages/technical_inpection/search_asset_view.dart'; -// import 'package:test_sa/modules/asset_delivery_module/pages/technical_inpection/status_checklist_view.dart'; -// import 'package:test_sa/modules/asset_delivery_module/pages/technical_inpection/technical_inpection_asset_card_view.dart'; -// import 'package:test_sa/modules/asset_delivery_module/pages/technical_inpection/update_child_asset_view.dart'; -// import 'package:test_sa/modules/asset_delivery_module/provider/asset_delivery_provider.dart'; -// import 'package:test_sa/modules/cm_module/views/components/action_button/footer_action_button.dart'; -// import 'package:test_sa/new_views/app_style/app_color.dart'; -// import 'package:test_sa/new_views/common_widgets/app_text_form_field.dart'; -// import 'package:test_sa/new_views/common_widgets/single_item_drop_down_menu.dart'; -// import 'package:test_sa/providers/gas_request_providers/site_provider.dart'; -// import 'package:test_sa/providers/loading_list_notifier.dart'; -// import 'package:test_sa/views/widgets/date_and_time/date_picker.dart'; -// import '../../../../models/new_models/department.dart'; -// import '../../../../new_views/common_widgets/app_filled_button.dart'; -// import '../../../../new_views/common_widgets/default_app_bar.dart'; -// -// //TODO need to refactor this screen when done ... -// -// class UpdateParentAssetView extends StatefulWidget { -// final TechnicalInspectionParentAssetModel assetModel; -// final int? lineId; -// -// UpdateParentAssetView({ -// Key? key, -// required this.assetModel, -// this.lineId, -// }) : super(key: key); -// -// @override -// State createState() => _UpdateParentAssetViewState(); -// } -// -// class _UpdateParentAssetViewState extends State { -// final GlobalKey _formKey = GlobalKey(); -// final GlobalKey _scaffoldKey = GlobalKey(); -// List checkList = []; -// late SiteProvider siteProvider; -// late AssetDeliveryProvider assetDeliveryProvider; -// -// @override -// void initState() { -// siteProvider = Provider.of(context, listen: false); -// assetDeliveryProvider = Provider.of(context, listen: false); -// // WidgetsBinding.instance.addPostFrameCallback((_) { -// populateForm(); -// // }); -// super.initState(); -// } -// -// void populateForm() async { -// // _model = widget.assetModel; -// assetDeliveryProvider.setModel(widget.assetModel); -// applyInspectionFlagsToChecklist(model: widget.assetModel,checklist: checkList); -// if (widget.assetModel.site != null) { -// await assetDeliveryProvider.getSiteData(siteId: widget.assetModel.site?.id, model: _model); -// } -// setState(() {}); -// } -// -// @override -// void dispose() { -// super.dispose(); -// } -// -// @override -// Widget build(BuildContext context) { -// return Scaffold( -// key: _scaffoldKey, -// appBar: DefaultAppBar( -// title: 'Parent Details'.addTranslation, -// titleStyle: AppTextStyles.heading3.copyWith(fontWeight: FontWeight.w500, color: context.isDark ? AppColor.neutral30 : AppColor.neutral50), -// ), -// body: Form( -// key: _formKey, -// child: Column( -// children: [ -// SingleChildScrollView( -// padding: const EdgeInsets.all(16), -// child: Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// inspectionDetailsForm(lineId: widget.lineId), -// 8.height, -// const Divider().defaultStyle(context), -// 8.height, -// childList(context), -// ], -// ).toShadowContainer(context, borderRadius: 20, padding: 12)) -// .expanded, -// FooterActionButton.footerContainer(context: context, child: AppFilledButton(buttonColor: AppColor.primary10, label: 'Save'.addTranslation, maxWidth: true, onPressed: _saveTap)), -// ], -// ), -// ), -// ); -// } -// -// Widget childList(BuildContext context) { -// final assetDeliveryTableList = ['abc', 'def', 'ghi', 'fhg', 'hjhh']; -// return Column( -// mainAxisSize: MainAxisSize.min, -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Row( -// children: [ -// Text( -// "Test List", -// style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.black10), -// ), -// 8.width, -// 'web_link_icon'.toSvgAsset().onPress(() { -// openInspectionChecklist(context); -// }), -// ], -// ), -// 8.height, -// ListView.separated( -// itemCount: assetDeliveryTableList.length, -// separatorBuilder: (_, __) => 8.height, -// padding: EdgeInsets.zero, -// shrinkWrap: true, -// physics: const NeverScrollableScrollPhysics(), -// itemBuilder: (listContext, itemIndex) { -// return TechnicalInspectionAssetCard( -// assetModel: TechnicalInspectionParentAssetModel(), -// ischild: true, -// editPress: () { -// Navigator.push(context, MaterialPageRoute(builder: (context) => UpdateChildAssetView())); -// }, -// isViewOnly: false, -// ); -// }, -// ), -// ], -// ); -// } -// -// Widget inspectionDetailsForm({int? lineId}) { -// return Column( -// children: [ -// //Replace with simple container... -// AppTextFormField( -// labelText: 'Asset Number'.addTranslation, -// backgroundColor: AppColor.fieldBgColor(context), -// initialValue: _model.assetNumber, -// textAlign: TextAlign.center, -// labelStyle: AppTextStyles.textFieldLabelStyle, -// textInputType: TextInputType.number, -// showShadow: false, -// enable: false, -// style: Theme.of(context).textTheme.titleMedium, -// ).onPress(() async { -// var data = await Navigator.push( -// context, -// MaterialPageRoute( -// builder: (context) => TechnicalInspectionSearchAssetView( -// lineId: lineId, -// ))); -// if (data != null) { -// TechnicalInspectionParentAssetModel? assetModel = await assetDeliveryProvider.getAssetDetails(assetId: data?.id); -// -// if (assetModel != null) { -// _model =TechnicalInspectionParentAssetModel(); -// setState(() { -// -// }); -// setState(() { -// _model = assetModel; -// }); -// if (assetModel.site != null) { -// await assetDeliveryProvider.getSiteData(siteId: assetModel.site?.id, model: _model); -// } -// setState(() {}); -// } -// } -// }), -// 8.height, -// AppTextFormField( -// labelText: 'Serial Number'.addTranslation, -// backgroundColor: AppColor.fieldBgColor(context), -// initialValue: _model.serialNo ?? '', -// textAlign: TextAlign.center, -// labelStyle: AppTextStyles.textFieldLabelStyle, -// textInputType: TextInputType.number, -// showShadow: false, -// onSaved: (value) { -// _model.serialNo = value; -// }, -// style: Theme.of(context).textTheme.titleMedium, -// ), -// 8.height, -// AppTextFormField( -// labelText: 'System ID'.addTranslation, -// backgroundColor: AppColor.fieldBgColor(context), -// initialValue: _model.systemId ?? '', -// textAlign: TextAlign.center, -// labelStyle: AppTextStyles.textFieldLabelStyle, -// showShadow: false, -// onSaved: (value) { -// _model.systemId = value; -// }, -// style: Theme.of(context).textTheme.titleMedium, -// ), -// 8.height, -// SingleItemDropDownMenu( -// context: context, -// title: 'Site', -// initialValue: _model.site, -// loading: assetDeliveryProvider.isSiteLoading, -// showAsBottomSheet: true, -// backgroundColor: AppColor.fieldBgColor(context), -// showShadow: false, -// // enabled: false, -// onSelect: (value) { -// if (value == null) { -// return; -// } -// _model.site = value; -// _model.building = null; -// _model.floor = null; -// _model.department = null; -// setState(() {}); -// }, -// ), -// 8.height, -// SingleItemDropDownMenu( -// context: context, -// title: 'Building', -// backgroundColor: AppColor.fieldBgColor(context), -// showAsBottomSheet: true, -// loading: assetDeliveryProvider.isSiteLoading, -// showShadow: false, -// initialValue: _model.building, -// enabled: _model.site?.buildings?.isNotEmpty ?? false, -// staticData: _model.site?.buildings ?? [], -// onSelect: (value) { -// if (value == null) { -// return; -// } -// _model.building = value; -// _model.floor = null; -// _model.department = null; -// setState(() {}); -// }, -// ), -// 8.height, -// SingleItemDropDownMenu( -// context: context, -// showAsBottomSheet: true, -// backgroundColor: AppColor.fieldBgColor(context), -// loading: assetDeliveryProvider.isSiteLoading, -// showShadow: false, -// title: 'Floor', -// initialValue: _model.floor, -// enabled: _model.building?.floors?.isNotEmpty ?? false, -// staticData: _model.building?.floors ?? [], -// onSelect: (value) { -// if (value == null) { -// return; -// } -// _model.floor = value; -// _model.department = null; -// setState(() {}); -// }, -// ), -// 8.height, -// SingleItemDropDownMenu( -// context: context, -// title: 'Department', -// backgroundColor: AppColor.fieldBgColor(context), -// loading: assetDeliveryProvider.isSiteLoading, -// showAsBottomSheet: true, -// showShadow: false, -// initialValue: _model.department, -// enabled: _model.floor?.departments?.isNotEmpty ?? false, -// staticData: _model.floor?.departments ?? [], -// onSelect: (value) { -// if (value == null) { -// return; -// } -// _model.department = value; -// _model.room = null; -// setState(() {}); -// }, -// ), -// -// 8.height, -// ADatePicker( -// label: 'Installation Date'.addTranslation, -// hideShadow: true, -// height: 56.toScreenHeight, -// backgroundColor: AppColor.fieldBgColor(context), -// date: _model.installationDate, -// // from: widget.pickerFromDate, -// formatDateWithTime: true, -// onDatePicker: (selectedDate) { -// showTimePicker( -// context: context, -// initialTime: TimeOfDay.now(), -// builder: (BuildContext context, Widget? child) { -// final ThemeData currentTheme = Theme.of(context); -// return Theme( -// data: currentTheme.copyWith( -// timePickerTheme: TimePickerThemeData( -// dialHandColor: AppColor.primary10, -// dialBackgroundColor: Colors.grey.withOpacity(0.1), -// hourMinuteColor: MaterialStateColor.resolveWith((states) => states.contains(MaterialState.selected) ? AppColor.primary10 : Colors.grey.withOpacity(0.1)), -// dayPeriodColor: MaterialStateColor.resolveWith((states) => states.contains(MaterialState.selected) ? AppColor.primary10 : Colors.transparent), -// dayPeriodTextColor: MaterialStateColor.resolveWith((states) => states.contains(MaterialState.selected) ? Colors.white : AppColor.primary10), -// dayPeriodBorderSide: BorderSide(color: Colors.grey.withOpacity(0.2)), -// entryModeIconColor: AppColor.primary10, -// ), -// textButtonTheme: TextButtonThemeData(style: TextButton.styleFrom(foregroundColor: AppColor.primary10)), -// ), -// child: child!, -// ); -// }, -// ).then((selectedTime) { -// if (selectedTime != null) { -// _model.installationDate = DateTime(selectedDate.year, selectedDate.month, selectedDate.day, selectedTime.hour, selectedTime.minute); -// setState(() {}); -// } -// }); -// }, -// ), -// 8.height, -// ], -// ); -// } -// -// ///Need to check which details show here... -// -// void _saveTap() async { -// _formKey.currentState!.save(); -// } -// -// Future openInspectionChecklist(BuildContext context) async { -// final result = await Navigator.push( -// context, -// MaterialPageRoute( -// builder: (context) => InspectionChecklistBottomSheet( -// initialValues: checkList, -// ))); -// -// log('result i got is $result'); -// if(result!=null){ -// checkList = result; -// setState(() {}); -// } -// if (checkList.isNotEmpty) { -// final isPass = checkList.every((e) => e.status == 'PASS'); -// log('Final Status: ${isPass ? 'PASS' : 'FAIL'}'); -// } -// final payload = buildInspectionPayload(checkList); -// -// log('API Payload: $payload'); -// // call this as bottomsheet. -// // final result = await showModalBottomSheet>>( -// // context: context, -// // isScrollControlled: true, -// // backgroundColor: Colors.transparent, -// // builder: (_) => const InspectionChecklistBottomSheet(), -// // ); -// } -// -// bool _isPass(List list, String title) { -// return list -// .firstWhere( -// (e) => e.title == title, -// orElse: () => InspectionChecklistItem(status: 'FAIL'), -// ) -// .status == -// 'PASS'; -// } -// -// Map buildInspectionPayload(List checklist) { -// return { -// 'flagphysicalInspection': _isPass(checklist, 'Physical Inspection As Per Manufacturer Instructions'), -// 'flagFunctionPerformance': _isPass(checklist, 'Functional Performance As Per Results Of Manufacturer Recommended Check List'), -// 'flagGroundingResistance': _isPass(checklist, 'Grounding Resistance: Ω'), -// 'flagChassiss': _isPass(checklist, 'Chassis Leakage Current: µA'), -// 'flagLeadsLeakage': _isPass(checklist, 'Leads Leakage Current: µA'), -// 'flagAlert': _isPass(checklist, 'This Device Is Not Subject To Any Alert Or Recall Until The Date Of Preparation Of This Inspection Form'), -// }; -// } -// -// void applyInspectionFlagsToChecklist({ -// required List checklist, -// required TechnicalInspectionParentAssetModel model, -// }) { -// for (final item in checklist) { -// switch (item.title) { -// case 'Physical Inspection As Per Manufacturer Instructions': -// item.status = _statusFromBool(model.flagphysicalInspection); -// break; -// -// case 'Functional Performance As Per Results Of Manufacturer Recommended Check List': -// item.status = _statusFromBool(model.flagFunctionPerformance); -// break; -// -// case 'Grounding Resistance: Ω': -// item.status = _statusFromBool(model.flagGroundingResistance); -// break; -// -// case 'Chassis Leakage Current: µA': -// item.status = _statusFromBool(model.flagChassiss); -// break; -// -// case 'Leads Leakage Current: µA': -// item.status = _statusFromBool(model.flagLeadsLeakage); -// break; -// -// case 'This Device Is Not Subject To Any Alert Or Recall Until The Date Of Preparation Of This Inspection Form': -// item.status = _statusFromBool(model.flagAlert); -// break; -// } -// } -// } -// String _statusFromBool(bool? value) { -// return value == true ? 'PASS' : 'FAIL'; -// } -// }