getFileExtension static method
Return file extension as String.
ie:- File("/../image.png")
to "png"
Implementation
static String getFileExtension(FileSystemEntity file) {
if (file is File) {
return file.path.split("/").last.split('.').last;
} else {
throw "FileSystemEntity is Directory, not a File";
}
}