import 'package:flutter/material.dart'; import 'package:watermanagement/settings.dart'; class BookingRequestsModel { String tanker_name = ''; String customer_address = ''; String customer_id = ''; String booking_id=''; String date_of_order=''; String type_of_water=''; String capacity=''; String price=''; String payment_status=''; String orderStatus=''; Color textColor=Colors.black; BookingRequestsModel(); factory BookingRequestsModel.fromJson(Map json){ BookingRequestsModel rtvm = new BookingRequestsModel(); rtvm.tanker_name = json['tankerName'] ?? ''; rtvm.customer_address = json['address'] ?? ''; rtvm.customer_id = json['customerId'] ?? ''; rtvm.booking_id = json['bookingid'] ?? ''; rtvm.type_of_water = json['typeofwater'] ?? ''; rtvm.capacity = json['capacity'] ?? ''; rtvm.price = json['price'] ?? ''; rtvm.payment_status = json['payment_status'] ?? ''; rtvm.orderStatus = json['orderStatus'] ?? ''; if(rtvm.orderStatus.toString().toLowerCase()=='accepted'){ rtvm.textColor=Colors.green; } else if(rtvm.orderStatus.toString().toLowerCase()=='rejected'){ rtvm.textColor=Colors.red; } else{ rtvm.textColor=primaryColor; } return rtvm; } }