import 'package:flutter/material.dart'; import 'package:healthcare_pharmacy/settings.dart'; class PharmacyAccountsModel { String pharmacyId = ''; String customerId = ''; String bookingId = ''; String biddingAmount = ''; String date = ''; String orderStatus = ''; String acceptedCount = ''; String pendingRejectedCount = ''; String deliveredCount = ''; String deliveredTotalPrice = ''; String deliveredTotalAmountPaid = ''; String deliveredTotalAmountDue = ''; Color payment_color=Colors.grey; String displayText = ''; PharmacyAccountsModel(); factory PharmacyAccountsModel.fromJson(Map json){ PharmacyAccountsModel rtvm = new PharmacyAccountsModel(); rtvm.pharmacyId = json['pharmacyId'] ?? ''; rtvm.customerId = json['customerId'] ?? ''; rtvm.bookingId = json['bookingId'] ?? ''; rtvm.biddingAmount = json['biddingAmount'] ?? ''; rtvm.date = json['date'] ?? ''; rtvm.orderStatus = json['status'] ?? ''; rtvm.acceptedCount = json['acceptedCount'] ?? ''; rtvm.pendingRejectedCount = json['pendingRejectedCount'] ?? ''; rtvm.deliveredCount = json['deliveredCount'] ?? ''; rtvm.deliveredTotalPrice = json['deliveredTotalPrice'] ?? ''; rtvm.deliveredTotalAmountPaid = json['deliveredTotalAmountPaid'] ?? ''; rtvm.deliveredTotalAmountDue = json['deliveredTotalAmountDue'] ?? ''; /* if(rtvm.orderStatus=='delivered' && rtvm.payment_status=='paid'){ rtvm.payment_color=Colors.green; rtvm.displayText='Payment Completed'; } else if(rtvm.orderStatus=='delivered' && rtvm.payment_status=='due'){ rtvm.payment_color=primaryColor; rtvm.displayText='Due'; }*/ return rtvm; } }