diff --git a/lib/models/all_requests_and_count_model.dart b/lib/models/all_requests_and_count_model.dart index aa04552a..310a3f72 100644 --- a/lib/models/all_requests_and_count_model.dart +++ b/lib/models/all_requests_and_count_model.dart @@ -113,6 +113,7 @@ class RequestsDetails { String date; String siteTransferFrom; String siteTransferTo; + int transactionType; RequestsDetails( {this.id, @@ -135,6 +136,7 @@ class RequestsDetails { this.code, this.siteTransferFrom, this.siteTransferTo, + this.transactionType, this.date}); RequestsDetails.fromJson(Map json) { @@ -159,6 +161,7 @@ class RequestsDetails { date = json['date']; siteTransferFrom = json['siteTransferFrom']; siteTransferTo = json['siteTransferTo']; + transactionType = json['transactionType']; } Map toJson() { @@ -184,6 +187,7 @@ class RequestsDetails { data['date'] = date; data['siteTransferFrom'] = siteTransferFrom; data['siteTransferTo'] = siteTransferTo; + data['transactionType'] = transactionType; return data; } } diff --git a/lib/new_views/pages/land_page/widgets/request_item_view_list.dart b/lib/new_views/pages/land_page/widgets/request_item_view_list.dart index d75e0af0..ca349b17 100644 --- a/lib/new_views/pages/land_page/widgets/request_item_view_list.dart +++ b/lib/new_views/pages/land_page/widgets/request_item_view_list.dart @@ -23,10 +23,15 @@ class RequestItemViewList extends StatelessWidget { padding: const EdgeInsets.all(16), itemBuilder: (cxt, index) { if (isLoading) return const SizedBox().toRequestShimmer(cxt, isLoading); - bool isServiceRequest = list[index].nameOfType == "ServiceRequest"; - bool isGasRefill = list[index].nameOfType == "GasRefill"; - bool isAssetTransfer = list[index].nameOfType == "AssetTransfer"; - bool isPPMs = list[index].nameOfType == "PPMs"; + // bool isServiceRequest = list[index].nameOfType == "ServiceRequest"; + // bool isGasRefill = list[index].nameOfType == "GasRefill"; + // bool isAssetTransfer = list[index].nameOfType == "AssetTransfer"; + // bool isPPMs = list[index].nameOfType == "PPMs"; + + bool isServiceRequest = list[index].transactionType == 1; + bool isGasRefill = list[index].transactionType == 2; + bool isAssetTransfer = list[index].transactionType == 3; + bool isPPMs = list[index].transactionType == 4; return isServiceRequest ? ServiceRequestItemView(list[index]) diff --git a/lib/views/widgets/pentry/pentry_ppm_check_list_form.dart b/lib/views/widgets/pentry/pentry_ppm_check_list_form.dart index 1dddcf11..acb21a94 100644 --- a/lib/views/widgets/pentry/pentry_ppm_check_list_form.dart +++ b/lib/views/widgets/pentry/pentry_ppm_check_list_form.dart @@ -25,7 +25,7 @@ class _PentryPMChecklistFormState extends State { @override Widget build(BuildContext context) { - final list = widget.models?.where((element) => element.task != null)?.toList(); + final list = widget.models?? [];//.where((element) => element.task != null)?.toList(); return (list?.isEmpty ?? true) ? context.translation.noDataFound.heading5(context).center : ListView.builder( @@ -45,7 +45,7 @@ class _PentryPMChecklistFormState extends State { } setState(() {}); }, - subtitle: showLabel.isNotEmpty && showLabel.contains(index) ? null : "${context.translation.status} ${list[index].taskStatusName}".bodyText(context), + subtitle: showLabel.isNotEmpty && showLabel.contains(index) ? null : "${context.translation.status} ${list[index].taskStatusName ?? ""}".bodyText(context), iconColor: context.isDark ? AppColor.neutral30 : AppColor.neutral50, collapsedIconColor: context.isDark ? AppColor.neutral30 : AppColor.neutral50, childrenPadding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 8.toScreenHeight),