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.
70 lines
1.6 KiB
70 lines
1.6 KiB
2 years ago
|
import 'package:flutter/material.dart';
|
||
|
|
||
|
|
||
|
class GetTanksDetailsModel {
|
||
|
String tanker_name = '';
|
||
|
String tanker_phone = '';
|
||
|
String tanker_alterphone = '';
|
||
|
String capacity='';
|
||
|
|
||
|
List type_of_water=[];
|
||
|
List showTypeofWater=[];
|
||
|
String water_type='';
|
||
|
|
||
|
|
||
|
List price=[];
|
||
|
List pricetype=[];
|
||
|
String price_ui='';
|
||
|
|
||
|
Color cardColor=Colors.white;
|
||
2 years ago
|
bool isDrinking=false;
|
||
|
bool isBore=false;
|
||
|
List updatedWaterTypes=[];
|
||
|
List updatePrice=[];
|
||
2 years ago
|
|
||
|
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.type_of_water = json['typeofwater'] ??[];
|
||
|
rtvm.type_of_water.forEach((element) {
|
||
|
rtvm.showTypeofWater.add(element['typeofwater']);
|
||
|
rtvm.water_type=rtvm.showTypeofWater.join(",");
|
||
|
|
||
|
|
||
2 years ago
|
|
||
|
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'});
|
||
|
}
|
||
|
|
||
|
|
||
2 years ago
|
});
|
||
|
|
||
|
rtvm.price = json['price'] ?? [];
|
||
|
rtvm.price.forEach((element) {
|
||
|
rtvm.pricetype.add(element['price']);
|
||
|
rtvm.price_ui=rtvm.pricetype.join(",");
|
||
|
|
||
|
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
return rtvm;
|
||
|
}
|
||
|
|
||
|
}
|