ppm improvements.

main_design2.1
Sikander Saleem 11 months ago
parent 5b7a9a25ca
commit 3cb97923c2

@ -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<String, dynamic> json) {
@ -159,6 +161,7 @@ class RequestsDetails {
date = json['date'];
siteTransferFrom = json['siteTransferFrom'];
siteTransferTo = json['siteTransferTo'];
transactionType = json['transactionType'];
}
Map<String, dynamic> toJson() {
@ -184,6 +187,7 @@ class RequestsDetails {
data['date'] = date;
data['siteTransferFrom'] = siteTransferFrom;
data['siteTransferTo'] = siteTransferTo;
data['transactionType'] = transactionType;
return data;
}
}

@ -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])

@ -25,7 +25,7 @@ class _PentryPMChecklistFormState extends State<PentryPMChecklistForm> {
@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<PentryPMChecklistForm> {
}
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),

Loading…
Cancel
Save