getProviderCredentialForWidget function
- WidgetRef ref,
- AiProvider provider
getProviderCredential for callers holding a WidgetRef rather than a Ref — a screen calling the proxy directly, as the curriculum import does. The two ref types share no supertype, so the read is passed in.
Implementation
Future<String?> getProviderCredentialForWidget(
WidgetRef ref,
AiProvider provider,
) => _credentialFor(provider, ref.read);