bool checkExtension(String path) { if (allowedExtensions == null) return true; return allowedExtensions! .contains(pathlib.extension(path).replaceFirst('.', '')); }