isValidApiKey function

bool isValidApiKey(
  1. String apiKey
)

Validate that an API key has the correct format.

Implementation

bool isValidApiKey(String apiKey) {
  return RegExp(r'^[a-zA-Z0-9\-_]+$').hasMatch(apiKey);
}