getDefaultApiKey static method
- String serviceType
Retrieve the default API key for a specific service type
Implementation
static Future<ApiKeyModel?> getDefaultApiKey(String serviceType) async {
List<ApiKeyModel> apiKeys = await getApiKeys();
try {
return apiKeys
.firstWhere((key) => key.serviceType == serviceType && key.isDefault);
} catch (e) {
return null;
}
}