initializeEngine method

Future<void> initializeEngine({
  1. required AgoraConnectionData agoraConnectionData,
})

Function to initialize the Agora RTC engine.

Implementation

Future<void> initializeEngine(
    {required AgoraConnectionData agoraConnectionData}) async {
  value = value.copyWith(connectionData: agoraConnectionData);

  await value.engine!
      .initialize(RtcEngineContext(appId: value.connectionData!.appId));
  log("SDK initialized: ${value.engine}", level: Level.error.value);
  // Getting SDK versions and assigning them
  SDKBuildInfo? rtcVersion = await value.engine?.getVersion();
  AgoraVersions.staticRTM = await AgoraRtmClient.getSdkVersion();
  if (rtcVersion?.version.toString() != null) {
    AgoraVersions.staticRTC = rtcVersion!.version.toString();
  }
}