encode method

  1. @override
String encode()
override

Implementation

@override
String encode() {
  Map map = {"localPath": this.localPath, "extra": this.extra};
  if (this.width != null) {
    map["width"] = this.width;
  }
  if (this.height != null) {
    map["height"] = this.height;
  }
  if (this.name != null) {
    map["name"] = this.name;
  }
  if (this.gifDataSize != null) {
    map["gifDataSize"] = this.gifDataSize;
  }
  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.remoteUrl != null && this.remoteUrl!.isNotEmpty) {
    map["remoteUrl"] = this.remoteUrl;
  }
  if (this.destructDuration != null && this.destructDuration! > 0) {
    map["burnDuration"] = this.destructDuration;
  }
  return json.encode(map);
}