decode method

  1. @override
void decode(
  1. String? jsonStr
)
override

Implementation

@override
void decode(String? jsonStr) {
  if (jsonStr == null || jsonStr == "") {
    developer.log("Flutter SightMessage deocde error: no content", name: "RongIMClient.SightMessage");
    return;
  }
  Map map = json.decode(jsonStr.toString());
  this.mName = map["name"];
  var size = map["size"] != null ? map["size"] : 0;
  if (size is String) {
    this.mSize = int.parse(size);
  } else {
    this.mSize = size;
  }
  this.localPath = map["localPath"];
  this.remoteUrl = map["sightUrl"];
  this.content = map["content"];
  this.mThumbUri = map["thumbUri"];
  var d = map["duration"];
  if (d is String) {
    this.duration = int.parse(d);
  } else {
    this.duration = d;
  }
  this.extra = map["extra"];
  Map? userMap = map["user"];
  super.decodeUserInfo(userMap);
  Map? menthionedMap = map["mentionedInfo"];
  super.decodeMentionedInfo(menthionedMap);
  this.destructDuration = map["burnDuration"];
}