clearFileNameFromPath method
Takes a file path as input and returns the path without the
Implementation
String clearFileNameFromPath(String path) {
final fileName = _getFileNameFromPath(path);
if (fileName != null) {
return path
.replaceAll(fileName, "")
.replaceAll("$fileName/", "")
.replaceAll("//", "/");
} else {
return path;
}
}