Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

showFileExtension is not working as expect #12

Open
zhuyijing opened this issue Apr 15, 2022 · 0 comments
Open

showFileExtension is not working as expect #12

zhuyijing opened this issue Apr 15, 2022 · 0 comments

Comments

@zhuyijing
Copy link

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:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. 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.

@zhuyijing zhuyijing changed the title showFileExtension is not working showFileExtension is not working as expect Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant