import 'package:bbyyy/beans/msg_bean_data_entity.dart'; msgBeanDataEntityFromJson(MsgBeanDataEntity data, Map json) { if (json['sender_uid'] != null) { data.senderUid = json['sender_uid'] is String ? int.tryParse(json['sender_uid']) : json['sender_uid'].toInt(); } if (json['sender_pic'] != null) { data.senderPic = json['sender_pic'].toString(); } if (json['sender_name'] != null) { data.senderName = json['sender_name'].toString(); } if (json['type'] != null) { data.type = json['type'].toString(); } if (json['key'] != null) { data.key = json['key'].toString(); } if (json['sent_at'] != null) { data.sentAt = json['sent_at'].toString(); } if (json['content'] != null) { data.content = json['content'].toString(); } if (json['uuid'] != null) { data.uuid = json['uuid'].toString(); } return data; } Map msgBeanDataEntityToJson(MsgBeanDataEntity entity) { final Map data = new Map(); data['sender_uid'] = entity.senderUid; data['sender_pic'] = entity.senderPic; data['sender_name'] = entity.senderName; data['type'] = entity.type; data['key'] = entity.key; data['sent_at'] = entity.sentAt; data['content'] = entity.content; data['uuid'] = entity.uuid; return data; }