SpeechToTextBeta.viaThirdPartyAuthenticator constructor
SpeechToTextBeta.viaThirdPartyAuthenticator(
- ThirdPartyAuthenticator thirdPartyAuthenticator, {
- String? cloudSpeechEndpoint,
- Map<
String, String> ? metadata,
Creates a SpeechToText interface using a third party authenticator. Don't worry about updating the access token, the package does it automatically. Example: final speechToText = SpeechToTextBeta.viaThirdPartyAuthenticator( ThirdPartyAuthenticator( obtainCredentialsFromThirdParty: () async { // request api to get token final json = await requestCredentialFromMyApi(); return AccessCredentials.fromJson(json); }, ), );
Implementation
factory SpeechToTextBeta.viaThirdPartyAuthenticator(
ThirdPartyAuthenticator thirdPartyAuthenticator, {
String? cloudSpeechEndpoint,
Map<String, String>? metadata,
}) =>
SpeechToTextBeta._(
thirdPartyAuthenticator.toCallOptions
.mergedWith(CallOptions(metadata: metadata ?? {})),
cloudSpeechEndpoint: cloudSpeechEndpoint);