file_manager
file_manager copied to clipboard
showFileExtension is not working as expect
Describe the bug
static String basename(dynamic entity, [bool showFileExtension = true]) {
if (entity is Directory) {
return entity.path.split('/').last;
} else if (entity is File) {
return (showFileExtension) ====> should be (!showFileExtension)
? entity.path.split('/').last.split('.').first
: entity.path.split('/').last;
} else {
print(
"Please provide a Object of type File, Directory or FileSystemEntity");
return "";
}
}
To Reproduce Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
**Logs **
Run flutter analyze and attach any output of that command below.
If there are any analysis errors, try resolving them before filing this issue.
Paste the output of running flutter doctor -v here.
Additional context Add any other context about the problem here.