fetchRoomInfo method

Future<void> fetchRoomInfo()

Implementation

Future<void> fetchRoomInfo() async {
  final result = await service.fetchRoomInfo();
  if (result.code == TUIError.success && result.data != null) {
    final TUIRoomInfo roomInfo = result.data!;
    state.roomId = roomInfo.roomId;
    state.roomName.value = roomInfo.name ?? '';
    state.ownerInfo.userId = roomInfo.ownerId;
    state.seatMode.value = roomInfo.seatMode;
    state.createTime = roomInfo.createTime;
    state.maxSeatCount.value = roomInfo.maxSeatCount;
    return;
  }
  toastSubject?.add(ErrorHandler.convertToErrorMessage(
          result.code.value(), result.message) ??
      '');
}