getKeys method

String? getKeys(
  1. String keyConstant
)

Gets a specific storage key from CDN config using constant identifiers

Implementation

String? getKeys(String keyConstant) {
  _ensureInitialized();
  try {
    final cachedConfig = getCDNConfig();

    // Use the constant to get the property name, then look up the value
    if (cachedConfig?.keys?[keyConstant] != null) {
      final value = cachedConfig!.keys![keyConstant];
      return value;
    }

    // Fallback to default config using the same property name
    final defaultValue = (_bundledConfig['keys'] as Map<String, dynamic>?)?[keyConstant] as String?;
    return defaultValue;
  } catch (e) {
    return (_bundledConfig['keys'] as Map<String, dynamic>?)?[keyConstant] as String?;
  }
}