mason_bricks icon indicating copy to clipboard operation
mason_bricks copied to clipboard

feat: Add freezed suport to model brick

Open LosDanieloss opened this issue 2 years ago โ€ข 3 comments

Brick

  • [x] model
  • [ ] feature_brick
  • [ ] app_ui
  • [ ] service
  • [ ] service_package

Status

READY

Breaking Changes

NO

Description

This pull request propose code changes required to address #13 Added way to choose model generator mode. Currently supported options are either freezed or none. It also adds post_gen.dart script that tries to add required dependencies using pub add and if freezed were used as generator mode runs build_runner.

Type of Change

  • [x] โœจ New feature (non-breaking change which adds functionality)
  • [ ] ๐Ÿ› ๏ธ Bug fix (non-breaking change which fixes an issue)
  • [ ] โŒ Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] ๐Ÿงน Code refactor
  • [ ] โœ… Build configuration change
  • [ ] ๐Ÿ“ Documentation
  • [ ] ๐Ÿ—‘๏ธ Chore

LosDanieloss avatar Jul 08 '22 13:07 LosDanieloss

~Important note is that after using new freezed mode project needs few dependencies to be in pubspec.yaml like build_runner, freezed and few more. It also requires to run build_runner after brick is executed. I'm wondering if it should be pointed in the documentation or maybe automated to some degree? Let me know your thoughts @LukeMoody01 on that. I'm happy to add it as part of this PR if necessary.~

LosDanieloss avatar Jul 08 '22 14:07 LosDanieloss

Converting to a draft to get feedback quicker. However after learning from Felix that ideally bricks would include required dependencies I'll work on that.

LosDanieloss avatar Jul 08 '22 14:07 LosDanieloss

Hey @LosDanieloss! ๐Ÿ‘‹

Thanks for opening this PR! I will make sure to have a look later today!

LukeMoody01 avatar Jul 09 '22 05:07 LukeMoody01

Due to #21, that makes this PR redundant.

Thank you for laying the foundation for this brick to support freezed, I really appreciate it! Apologies that it's taken so long to get around to this.

Thanks again!

LukeMoody01 avatar Oct 02 '22 05:10 LukeMoody01