| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- import 'package:bbyyy/beans/msg_bean_data_entity.dart';
- msgBeanDataEntityFromJson(MsgBeanDataEntity data, Map<String, dynamic> 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<String, dynamic> msgBeanDataEntityToJson(MsgBeanDataEntity entity) {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- 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;
- }
|