ensureSdkLoaded method
Ensures the Twilio Voice JS SDK is loaded and window.Twilio is available.
The SDK is bundled with this package, so apps do not need to add a <script> tag to their
web/index.html. If the SDK is already present - because the app loads it itself (e.g. a
CDN <script> tag, as previous versions of this plugin required) - the bundled copy is not
injected and the existing global is used, so existing integrations keep working.
Called automatically by setTokens; exposed so apps can pre-load the SDK earlier (e.g. during splash) if desired. Completes with an error if the SDK could not be loaded; the failure is not cached, so a later call will retry.
Implementation
Future<void> ensureSdkLoaded() => _sdkLoadFuture ??= _loadSdk();