import 'package:bbyyy/beans/d_b_message_bean_entity.dart'; dBMessageBeanEntityFromJson(DBMessageBeanEntity data, Map json) { if (json['uuid'] != null) { data.uuid = json['uuid'].toString(); } if (json['sent_at'] != null) { data.sentAt = json['sent_at'].toString(); } if (json['receiver_uid'] != null) { data.receiverUid = json['receiver_uid'] is String ? int.tryParse(json['receiver_uid']) : json['receiver_uid'].toInt(); } if (json['receiver_name'] != null) { data.receiverName = json['receiver_name'].toString(); } if (json['receiver_pic'] != null) { data.receiverPic = json['receiver_pic'].toString(); } if (json['sender_uid'] != null) { data.senderUid = json['sender_uid'] is String ? int.tryParse(json['sender_uid']) : json['sender_uid'].toInt(); } if (json['sender_name'] != null) { data.senderName = json['sender_name'].toString(); } if (json['sender_pic'] != null) { data.senderPic = json['sender_pic'].toString(); } if (json['type'] != null) { data.type = json['type'].toString(); } if (json['content'] != null) { data.content = json['content'].toString(); } return data; } Map dBMessageBeanEntityToJson(DBMessageBeanEntity entity) { final Map data = new Map(); data['uuid'] = entity.uuid; data['sent_at'] = entity.sentAt; data['receiver_uid'] = entity.receiverUid; data['receiver_name'] = entity.receiverName; data['receiver_pic'] = entity.receiverPic; data['sender_uid'] = entity.senderUid; data['sender_name'] = entity.senderName; data['sender_pic'] = entity.senderPic; data['type'] = entity.type; data['content'] = entity.content; return data; }