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

[BUG]: Build Issue with FlutterGen When Excluding Paths with Special Characters in Filenames #509

Open
2 tasks done
sAtluna opened this issue Apr 24, 2024 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@sAtluna
Copy link

sAtluna commented Apr 24, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Version

5.4.0

Command type

build_runner (Default)

What happened?

Hello,

I've been using your package and encountered a specific problem when excluding directories in pubspec.yaml for FlutterGen. This issue involves handling filenames with special characters, such as a plus sign (+), which aren't processed correctly despite being in an excluded directory.

Configuration:

flutter_gen:
  output: lib/assets/
  assets:
    outputs:
      class_name: MyAssets
    exclude:
      - assets-extern/

Problem:
Despite excluding the assets-extern/ directory, FlutterGen processes files from this directory, leading to a build error:

Operator declarations must be preceded by the keyword 'operator'.
AssetGenImage get myasset+ffffff => const AssetGenImage('assets-extern/myasset+_fffff.jpg');

It seems, that FlutterGen is parsing first everything and then applying a filter with the declared excluded paths. I understand this is a very special case due to the unique filenames connected to our database models. However, I confirmed the build runner recognizes this configuration. Is there a possible solution to handle filenames with special characters?

Thank you!

Relevant a pubspec.yaml.

flutter_gen:
  output: lib/assets/ 
  
  assets:
    outputs:
      class_name: MyAssets

    exclude:
      - assets-extern/

Relevant log output

Operator declarations must be preceded by the keyword 'operator'.

        AssetGenImage get myasset+ffffff => const AssetGenImage('assets-extern/myasset+_fffff.jpg');

Code of Conduct

  • I agree to follow this project's Code of Conduct
@sAtluna sAtluna added the bug Something isn't working label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant