switchRoom method

Future<Map> switchRoom(
  1. String fromRoomID,
  2. dynamic toRoomInfo,
  3. bool isCreateWhenRoomNotExisted,
  4. dynamic config,
)

Implementation

Future<Map<dynamic, dynamic>> switchRoom(
    String fromRoomID,
    dynamic toRoomInfo,
    bool isCreateWhenRoomNotExisted,
    dynamic config) async {
  Object _config = mapToJSObj(config);
  final result = await promiseToFuture(ZIM.getInstance()!.switchRoom(
          fromRoomID,
          mapToJSObj(toRoomInfo),
          isCreateWhenRoomNotExisted,
          _config))
      .catchError((e) {
    throw PlatformException(code: e.code.toString(), message: e.message);
  });
  return jsObjectToMap(result);
}