toMap method Null safety

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() => <String, dynamic>{
  "messageId": messageId,
  if(type != null) "type": SystemMessageTypeConverter(type: type).toValue(),
  "fromAccount": fromAccount,
  "targetId": targetId,
  "time": time,
  if(status != null)  "status": SystemMessageStatusConverter(status: status).toValue(),
  "content": content,
  "attach": attach,
  "unread": unread,
  "customInfo": customInfo
};