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.
watermanagement-supplier/lib/models/tankersview_model.dart

67 lines
1.7 KiB

import 'package:flutter/material.dart';
class GetTanksDetailsModel {
String tanker_name = '';
String tanker_phone = '';
String tanker_alterphone = '';
String capacity='';
String waterprice='';
Color cardColor=Colors.white;
String type_of_water='';
/*List type_of_water=[];
List showTypeofWater=[];
String water_type='';
List price=[];
List pricetype=[];
String price_ui='';
Color cardColor=Colors.white;
bool isDrinking=false;
bool isBore=false;
List updatedWaterTypes=[];
List updatePrice=[];*/
GetTanksDetailsModel();
factory GetTanksDetailsModel.fromJson(Map<String, dynamic> json){
GetTanksDetailsModel rtvm = new GetTanksDetailsModel();
rtvm.tanker_name = json['tankerName'] ?? '';
rtvm.tanker_phone = json['phoneNumber'] ?? '';
rtvm.tanker_alterphone = json['alternative_phoneNumber'] ?? '';
rtvm.capacity = json['capacity'] ??'';
rtvm.waterprice = json['price'] ??'';
rtvm.type_of_water = json['typeofwater'] ??"";
/* rtvm.type_of_water.forEach((element) {
rtvm.showTypeofWater.add(element['typeofwater']);
rtvm.water_type=rtvm.showTypeofWater.join(",");
if(element['typeofwater'].toString().toLowerCase()=='drinking water'){
rtvm.isDrinking=true;
rtvm.updatedWaterTypes.add({'typeofwater': 'Drinking Water'});
}
else if(element['typeofwater'].toString().toLowerCase()=='bore water'){
rtvm.isBore=true;
rtvm.updatedWaterTypes.add({'typeofwater': 'Bore Water'});
}
});*/
/* rtvm.price = json['price'] ?? [];
rtvm.price.forEach((element) {
rtvm.pricetype.add(element['price']);
rtvm.price_ui=rtvm.pricetype.join(",");
});
*/
return rtvm;
}
}