-
Notifications
You must be signed in to change notification settings - Fork 116
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
Freezed entities don't work well with objectbox_generator #424
Comments
I faced the same issue, there is some kind of conflict with auto_route generator |
@awaik Thanks for answering! My comment also applies here: if you ever find out if this is because something ObjectBox can improve, let us know! |
Without additional information, we are unfortunately not sure how to resolve this issue. Therefore this issue has been automatically closed. Feel free to comment with additional details and we can re-open this issue. |
In my case it happens because objectbox runs BEFORE freezed. |
Resolved this issue by extending |
@vlado-rudenok Are you planning on doing PR to freezed package with that? |
The freezed author commented that
So to support ordering with any other code generator, is it possible to define order of generators in a custom |
Just stumbled onto this, so leaving it here: https://github.com/dart-lang/build/blob/master/docs/faq.md#how-can-i-adjust-builder-ordering says it's possible to define ordering in your
With this it should be possible to make freezed run before the ObjectBox generator. Will have a look. |
Is there any clarity on the plans to support these |
@endasan If it works, this is not something the ObjectBox package can fix. We could only provide documentation on how to add this to a |
ObjectBox Generator doesn't generate
objectbox-model.json
andobjectbox.g.dart
with freezed entities.As a workaround I found that using
flutter pub run build_runner watch --delete-conflicting-outputs
and changing just one of the entity's@Id(assignable: )
fromtrue
tofalse
and vice-versa does the trick sometimes.Basic info (please complete the following information):
Additionally, you can choose to provide more details, e.g. the output of:
pub deps --no-dev
:flutter doctor -v
:Steps to reproduce
flutter pub run build_runner build --delete-conflicting-outputs
Expected behavior
Should generate
objectbox-model.json
andobjectbox.g.json
.Code
Here's my
pubspec.yaml
:Using
flutter pub run build_runner watch --delete-conflicting-outputs
and changing just one of the entity's@Id(assignable: )
fromtrue
tofalse
does the trick sometimes.The text was updated successfully, but these errors were encountered: