ppm improvements.

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

@ -113,6 +113,7 @@ class RequestsDetails {
String date; String date;
String siteTransferFrom; String siteTransferFrom;
String siteTransferTo; String siteTransferTo;
int transactionType;
RequestsDetails( RequestsDetails(
{this.id, {this.id,
@ -135,6 +136,7 @@ class RequestsDetails {
this.code, this.code,
this.siteTransferFrom, this.siteTransferFrom,
this.siteTransferTo, this.siteTransferTo,
this.transactionType,
this.date}); this.date});
RequestsDetails.fromJson(Map<String, dynamic> json) { RequestsDetails.fromJson(Map<String, dynamic> json) {
@ -159,6 +161,7 @@ class RequestsDetails {
date = json['date']; date = json['date'];
siteTransferFrom = json['siteTransferFrom']; siteTransferFrom = json['siteTransferFrom'];
siteTransferTo = json['siteTransferTo']; siteTransferTo = json['siteTransferTo'];
transactionType = json['transactionType'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -184,6 +187,7 @@ class RequestsDetails {
data['date'] = date; data['date'] = date;
data['siteTransferFrom'] = siteTransferFrom; data['siteTransferFrom'] = siteTransferFrom;
data['siteTransferTo'] = siteTransferTo; data['siteTransferTo'] = siteTransferTo;
data['transactionType'] = transactionType;
return data; return data;
} }
} }

@ -23,10 +23,15 @@ class RequestItemViewList extends StatelessWidget {
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
itemBuilder: (cxt, index) { itemBuilder: (cxt, index) {
if (isLoading) return const SizedBox().toRequestShimmer(cxt, isLoading); if (isLoading) return const SizedBox().toRequestShimmer(cxt, isLoading);
bool isServiceRequest = list[index].nameOfType == "ServiceRequest"; // bool isServiceRequest = list[index].nameOfType == "ServiceRequest";
bool isGasRefill = list[index].nameOfType == "GasRefill"; // bool isGasRefill = list[index].nameOfType == "GasRefill";
bool isAssetTransfer = list[index].nameOfType == "AssetTransfer"; // bool isAssetTransfer = list[index].nameOfType == "AssetTransfer";
bool isPPMs = list[index].nameOfType == "PPMs"; // 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 return isServiceRequest
? ServiceRequestItemView(list[index]) ? ServiceRequestItemView(list[index])

@ -25,7 +25,7 @@ class _PentryPMChecklistFormState extends State<PentryPMChecklistForm> {
@override @override
Widget build(BuildContext context) { 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) return (list?.isEmpty ?? true)
? context.translation.noDataFound.heading5(context).center ? context.translation.noDataFound.heading5(context).center
: ListView.builder( : ListView.builder(
@ -45,7 +45,7 @@ class _PentryPMChecklistFormState extends State<PentryPMChecklistForm> {
} }
setState(() {}); 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, iconColor: context.isDark ? AppColor.neutral30 : AppColor.neutral50,
collapsedIconColor: context.isDark ? AppColor.neutral30 : AppColor.neutral50, collapsedIconColor: context.isDark ? AppColor.neutral30 : AppColor.neutral50,
childrenPadding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 8.toScreenHeight), childrenPadding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 8.toScreenHeight),

Loading…
Cancel
Save