fetchLiveInfo method

Future<void> fetchLiveInfo(
  1. String roomId
)

Implementation

Future<void> fetchLiveInfo(String roomId) async {
  final result = await service.fetchLiveInfo(roomId);
  if (result.code == TUIError.success && result.data != null) {
    final TUILiveInfo liveInfo = result.data!;
    state.coverUrl.value = liveInfo.coverUrl;
    state.liveExtraInfo.value.liveMode.value = liveInfo.isPublicVisible
        ? PrivacyStatus.publicity
        : PrivacyStatus.privacy;
    state.backgroundUrl.value = liveInfo.backgroundUrl;
    return;
  }
  toastSubject?.add(ErrorHandler.convertToErrorMessage(
          result.code.value(), result.message) ??
      '');
}