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

feat: handle package name for fonts #567

Conversation

TesteurManiak
Copy link
Contributor

@TesteurManiak TesteurManiak commented Sep 3, 2024

What does this change?

Fixes #357 🎯

Parse package_parameter_enabled for the fonts property and add a package accessor to the generated font class.

Example

class MyFonts {
  MyFonts._();

  static const String package = 'design_system';

  /// Font family: Arial Black
  static const String arialBlack = 'packages/$package/Arial Black';

  /// Font family: Calibri
  static const String calibri = 'packages/$package/Calibri';
}

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

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 test)
    • Ensure the analyzer and formatter pass (melos run format to automatically apply formatting)
  • Appropriate docs were updated (if necessary)

@AlexV525
Copy link
Member

AlexV525 commented Sep 7, 2024

The changes look good at this point, but we need tests for it.

@TesteurManiak
Copy link
Contributor Author

The changes look good at this point, but we need tests for it.

I've added a test case to fonts_gen_test.dart

Copy link

codecov bot commented Sep 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.62%. Comparing base (0f44829) to head (77007c9).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #567      +/-   ##
==========================================
+ Coverage   97.55%   97.62%   +0.07%     
==========================================
  Files          24       24              
  Lines         860      886      +26     
==========================================
+ Hits          839      865      +26     
  Misses         21       21              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Thanks for the new feature!

@AlexV525 AlexV525 merged commit 2e0557e into FlutterGen:main Sep 9, 2024
5 checks passed
@TesteurManiak TesteurManiak deleted the feat/357-package-parameter-enabled-flag-for-fonts branch September 9, 2024 06:01
@AlexV525 AlexV525 added this to the 5.8.0 milestone Oct 1, 2024
@AlexV525 AlexV525 mentioned this pull request Oct 1, 2024
wasabeef pushed a commit that referenced this pull request Oct 8, 2024
## 5.8.0

**Feature**
- [#555](#555) Support
build.yaml to configure. by [@b2nkuu](https://github.com/b2nkuu)
- [#567](#567) Generate
the `package` constant for generated font classes. by
[@TesteurManiak](https://github.com/TesteurManiak)
- [#569](#569) Enables
`gaplessPlayback` by default for image assets. by
[@AlexV525](https://github.com/AlexV525)
- [#580](#580) Allows
`mime: '>=1.0.0 <3.0.0'`. by [@AlexV525](https://github.com/AlexV525)

**Development**
- [#563](#563) Fix
concurrency execution with melos. by
[@wasabeef](https://github.com/wasabeef)
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.

[FR]: package_parameter_enabled flag in fonts.outputs
2 participants