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; GetTanksDetailsModel(); factory GetTanksDetailsModel.fromJson(Map 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(","); }); rtvm.price = json['price'] ?? []; rtvm.price.forEach((element) { rtvm.pricetype.add(element['price']); rtvm.price_ui=rtvm.pricetype.join(","); }); return rtvm; } }