getFileNameWithoutExtension function
Implementation
String getFileNameWithoutExtension(String path) {
// Get the file name from the path
String fileName = File(path).uri.pathSegments.last;
// Remove the extension
return fileName.contains('.')
? fileName.substring(0, fileName.lastIndexOf('.'))
: fileName;
}