fromJson static method

VisitorJsonResult fromJson(
  1. dynamic json
)

Implementation

static VisitorJsonResult fromJson(dynamic json) {
  Visitor visitor = Visitor.fromJson(json['data']);
  //
  SpUtil.putString(BytedeskConstants.VISITOR_UID, visitor.uid!);
  SpUtil.putString(BytedeskConstants.VISITOR_NICKNAME, visitor.nickname!);
  SpUtil.putString(BytedeskConstants.VISITOR_AVATAR, visitor.avatar!);
  //
  return VisitorJsonResult(
      message: json["message"],
      code: json["code"],
      visitor: visitor
  );
}