isValidCatalogKeyPath function
Implementation
bool isValidCatalogKeyPath(String value) {
final trimmed = value.trim();
if (trimmed.isEmpty || trimmed.startsWith('.') || trimmed.endsWith('.') || trimmed.contains('..')) {
return false;
}
final segmentPattern = RegExp(r'^[a-zA-Z0-9_]+$');
return trimmed.split('.').every(segmentPattern.hasMatch);
}