hasValidExtension static method
Check if file path has valid extension
filePath - The file path
allowedExtensions - List of allowed extensions
Returns true if file has valid extension
Implementation
static bool hasValidExtension(String filePath, List<String> allowedExtensions) {
final extension = getFileExtension(filePath);
return allowedExtensions.any((ext) => ext.toLowerCase() == extension.toLowerCase());
}