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

Allowed the generated values statement to optionally be static. Fixes #415 #435

Merged
merged 4 commits into from
Oct 18, 2023

Conversation

bramp
Copy link
Contributor

@bramp bramp commented Oct 16, 2023

What does this change?

Allowed the generated values statement to optionally be static. For flat listings, each asset is static but the values property is not, making it inaccessible. Now when generating flat listings, values is static like all the other assets.

Fixes #415 🎯

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open a GitHub issue as a bug/feature request before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
    • Ensure the tests (melos run unit:test)
    • Ensure the analyzer and formatter pass (melos run format to automatically apply formatting)

@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

Merging #435 (d1569e9) into main (32f974e) will not change coverage.
The diff coverage is 100.00%.

❗ Current head d1569e9 differs from pull request most recent head 1e10f70. Consider uploading reports for the commit 1e10f70 to get more accurate results

@@           Coverage Diff           @@
##             main     #435   +/-   ##
=======================================
  Coverage   98.26%   98.26%           
=======================================
  Files          20       20           
  Lines         691      691           
=======================================
  Hits          679      679           
  Misses         12       12           
Files Coverage Δ
packages/core/lib/generators/assets_generator.dart 98.08% <100.00%> (ø)

Copy link
Member

@AlexV525 AlexV525 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a unit test for the fix? Even though the coverage hasn't been changed, it actually did.

@bramp
Copy link
Contributor Author

bramp commented Oct 17, 2023

The fix is already covered in existing unit tests. Both assets_camel_case.gen.dart and assets_snake_case.gen.dart were modified to check the correct behaviour with flat style. Existing dot style does not use static, and their tests continue to work.

So I do believe it is tested (both with and without static), so I would be unsure what test to add.

@AlexV525
Copy link
Member

The fix is already covered in existing unit tests. Both assets_camel_case.gen.dart and assets_snake_case.gen.dart were modified to check the correct behaviour with flat style. Existing dot style does not use static, and their tests continue to work.

Appreciate your explanation!

Copy link
Member

@AlexV525 AlexV525 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'm not so familiar with versioning so I guess we can add CHANGELOG entries later.

@AlexV525 AlexV525 merged commit a0ae85f into FlutterGen:main Oct 18, 2023
@AlexV525 AlexV525 added this to the 5.4.0 milestone Oct 18, 2023
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

Successfully merging this pull request may close these issues.

[BUG]: Unable to access the values when build with style: camel_case
2 participants