encode method

  1. @override
String encode()
override

Implementation

@override
String encode() {
  Map map = Map();
  if (this.extra != null) {
    map["extra"] = this.extra;
  }
  if (this.mType != null) {
    map["type"] = this.mType;
  } else {
    map["type"] = "";
  }
  if (this.mName != null) {
    map["name"] = this.mName;
  } else {
    map["name"] = "";
  }
  if (this.mSize != null) {
    map["size"] = this.mSize;
  } else {
    map["size"] = 0;
  }
  if (this.localPath != null) {
    map["localPath"] = this.localPath;
  } else {
    map["localPath"] = "";
  }
  if (mMediaUrl != null && mMediaUrl!.length > 0) {
    map['fileUrl'] = mMediaUrl;
  }
  if (this.sendUserInfo != null) {
    Map userMap = super.encodeUserInfo(this.sendUserInfo);
    map["user"] = userMap;
  }
  if (this.mentionedInfo != null) {
    Map mentionedMap = super.encodeMentionedInfo(this.mentionedInfo);
    map["mentionedInfo"] = mentionedMap;
  }
  // if (this.destructDuration != null && this.destructDuration > 0) {
  //   map["burnDuration"] = this.destructDuration;
  // }
  return json.encode(map);
}