mason_bricks
mason_bricks copied to clipboard
feat: Add freezed suport to model brick
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
~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.~
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.
Hey @LosDanieloss! ๐
Thanks for opening this PR! I will make sure to have a look later today!
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!