import 'package:bbyyy/beans/new_order_bean_entity.dart'; newOrderBeanEntityFromJson(NewOrderBeanEntity data, Map json) { if (json['type'] != null) { data.type = json['type'].toString(); } if (json['content'] != null) { data.content = NewOrderBeanContent().fromJson(json['content']); } return data; } Map newOrderBeanEntityToJson(NewOrderBeanEntity entity) { final Map data = new Map(); data['type'] = entity.type; data['content'] = entity.content?.toJson(); return data; } newOrderBeanContentFromJson(NewOrderBeanContent data, Map json) { if (json['UID'] != null) { data.uID = json['UID'] is String ? int.tryParse(json['UID']) : json['UID'].toInt(); } if (json['State'] != null) { data.state = json['State'] is String ? int.tryParse(json['State']) : json['State'].toInt(); } if (json['SellerID'] != null) { data.sellerID = json['SellerID'] is String ? int.tryParse(json['SellerID']) : json['SellerID'].toInt(); } if (json['CreateTime'] != null) { data.createTime = json['CreateTime'].toString(); } if (json['ShopUID'] != null) { data.shopUID = json['ShopUID'] is String ? int.tryParse(json['ShopUID']) : json['ShopUID'].toInt(); } if (json['Amount'] != null) { data.amount = json['Amount'] is String ? double.tryParse(json['Amount']) : json['Amount'].toDouble(); } if (json['Hash'] != null) { data.hash = json['Hash'].toString(); } if (json['BuyerName'] != null) { data.buyerName = json['BuyerName'].toString(); } if (json['ShopPic'] != null) { data.shopPic = json['ShopPic'].toString(); } if (json['ShopID'] != null) { data.shopID = json['ShopID'] is String ? int.tryParse(json['ShopID']) : json['ShopID'].toInt(); } if (json['SellerName'] != null) { data.sellerName = json['SellerName'].toString(); } if (json['SellerPic'] != null) { data.sellerPic = json['SellerPic'].toString(); } if (json['BuyerPic'] != null) { data.buyerPic = json['BuyerPic'].toString(); } if (json['SellerUID'] != null) { data.sellerUID = json['SellerUID'] is String ? int.tryParse(json['SellerUID']) : json['SellerUID'].toInt(); } if (json['BuyerUID'] != null) { data.buyerUID = json['BuyerUID'] is String ? int.tryParse(json['BuyerUID']) : json['BuyerUID'].toInt(); } if (json['ShopName'] != null) { data.shopName = json['ShopName'].toString(); } if (json['ID'] != null) { data.iD = json['ID'] is String ? int.tryParse(json['ID']) : json['ID'].toInt(); } return data; } Map newOrderBeanContentToJson(NewOrderBeanContent entity) { final Map data = new Map(); data['UID'] = entity.uID; data['State'] = entity.state; data['SellerID'] = entity.sellerID; data['CreateTime'] = entity.createTime; data['ShopUID'] = entity.shopUID; data['Amount'] = entity.amount; data['Hash'] = entity.hash; data['BuyerName'] = entity.buyerName; data['ShopPic'] = entity.shopPic; data['ShopID'] = entity.shopID; data['SellerName'] = entity.sellerName; data['SellerPic'] = entity.sellerPic; data['BuyerPic'] = entity.buyerPic; data['SellerUID'] = entity.sellerUID; data['BuyerUID'] = entity.buyerUID; data['ShopName'] = entity.shopName; data['ID'] = entity.iD; return data; }