rtcEngine$onLoginResult$errorCode$elapsed method

FutureOr<void> rtcEngine$onLoginResult$errorCode$elapsed(
  1. dynamic engine,
  2. dynamic uid,
  3. dynamic errorCode,
  4. dynamic elapsed,
)
override

@detail callback @author hanchenchen.c @brief Login result callback @param engine ByteRTCEngine object @param uid
Login user ID @param errorCode
Login result
See ByteRTCLoginErrorCode{@link #ByteRTCLoginErrorCode}. @param elapsed
The time it takes from calling the login:uid:{@link #ByteRTCEngine#login:uid} interface to return the result.
Is in ms. @note Receive this callback after calling login:uid:{@link #ByteRTCEngine#login:uid}.

Implementation

FutureOr<void> rtcEngine$onLoginResult$errorCode$elapsed(
    dynamic engine, dynamic uid, dynamic errorCode, dynamic elapsed) async {
  if ($instance == null || $instance is! IRTCEngineEventHandler) {
    return;
  }
  return ($instance as IRTCEngineEventHandler).onLoginResult?.call(
      uid.toString(),
      t_LoginErrorCode.ios_to_code($p_i.ByteRTCLoginErrorCode.values
          .firstWhere((t) => t.$value == errorCode || t.name == errorCode)),
      int.tryParse(elapsed.toString()) ?? 0);
}