You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86 lines
2.6 KiB
86 lines
2.6 KiB
import 'package:flutter/material.dart';
|
|
import 'package:bookatanker/common/settings.dart';
|
|
class UserAccountsModel {
|
|
|
|
String tanker_name = '';
|
|
String dateOfOrder = '';
|
|
String tankName = '';
|
|
String tankLocation = '';
|
|
String bookingid = '';
|
|
String typeofwater = '';
|
|
String capacity = '';
|
|
String address = '';
|
|
String price = '';
|
|
String payment_status = '';
|
|
String orderStatus = '';
|
|
String delivery_agent = '';
|
|
String delivery_agent_mobile = '';
|
|
String initial_water_level = '';
|
|
String final_water_level = '';
|
|
String start_time = '';
|
|
String stop_time = '';
|
|
String quantityDelivered = '';
|
|
String amount_paid = '';
|
|
String amount_due = '';
|
|
String payment_mode = '';
|
|
String customerPhone = '';
|
|
String supplierPhone = '';
|
|
String customerName = '';
|
|
String supplierName = '';
|
|
Color payment_color=Colors.grey;
|
|
String displayText = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UserAccountsModel();
|
|
|
|
|
|
factory UserAccountsModel.fromJson(Map<String, dynamic> json){
|
|
UserAccountsModel rtvm = new UserAccountsModel();
|
|
|
|
rtvm.tanker_name = json['tankerName'] ?? '';
|
|
|
|
rtvm.dateOfOrder = json['dateOfOrder'] ?? '';
|
|
rtvm.tankName = json['tankName'] ?? '';
|
|
rtvm.tankLocation = json['tankLocation'] ?? '';
|
|
rtvm.bookingid = json['bookingid'] ?? '';
|
|
rtvm.typeofwater = json['typeofwater'] ?? '';
|
|
rtvm.capacity = json['capacity'] ?? '';
|
|
rtvm.address = json['address'] ?? '';
|
|
rtvm.price = json['price'] ?? '';
|
|
rtvm.payment_status = json['payment_status'] ?? '';
|
|
rtvm.orderStatus = json['orderStatus'] ?? '';
|
|
rtvm.delivery_agent = json['delivery_agent'] ?? '';
|
|
rtvm.delivery_agent_mobile = json['delivery_agent_mobile'] ?? '';
|
|
rtvm.initial_water_level = json['initial_water_level'] ?? '';
|
|
rtvm.final_water_level = json['final_water_level'] ?? '';
|
|
rtvm.start_time = json['start_time'] ?? '';
|
|
rtvm.stop_time = json['stop_time'] ?? '';
|
|
rtvm.quantityDelivered = json['quantityDelivered'] ?? '';
|
|
rtvm.amount_paid = json['amount_paid'] ?? '';
|
|
rtvm.amount_due = json['amount_due'] ?? '';
|
|
rtvm.payment_mode = json['payment_mode'] ?? '';
|
|
rtvm.customerPhone = json['customerPhone'] ?? '';
|
|
rtvm.supplierPhone = json['supplierPhone'] ?? '';
|
|
rtvm.customerName = json['customerName'] ?? '';
|
|
rtvm.supplierName = json['supplierName'] ?? '';
|
|
|
|
|
|
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;
|
|
}
|
|
|
|
} |