getRoomInfo static method

Future<ChatRoomModel> getRoomInfo({
  1. required String roomId,
})

방 정보 조회

Implementation

static Future<ChatRoomModel> getRoomInfo({required String roomId}) async {
  var uri = ApiPath.getRoomInfo.addGetParam({"roomId": roomId});
  var request = await get(uri);

  var aa = "flutter_vchatcloud_sdk_open_api_";
  var a = Encrypted.fromBase64(
      "P/WY2Q2XNtup38A3mJPVk/ma3kPa770t1GQ/ClVPwEUkTWpaz9kzx7RQScuoK4mY");
  var b = Encrypter(AES(
    Key.fromUtf8(aa),
    mode: AESMode.cbc,
    padding: 'PKCS7',
  ));
  var c = IV.fromUtf8(aa.substring(0, 16));
  var d = b.decrypt(a, iv: c);

  // Decrypt
  var e = Encrypter(AES(
    Key.fromUtf8(d),
    mode: AESMode.cbc,
    padding: 'PKCS7',
  ));

  var data = json.decode(request.body)['data'];
  var rd = base64Decode(data);
  var en = Encrypted(rd);
  var iv = IV.fromUtf8(d.substring(0, 16));

  var result = e.decrypt(en, iv: iv);
  var model = ChatRoomModel.fromJson(json.decode(result));
  return model;
}