You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bug here is that you cannot use a backlink if not in the same file/library.
That may be more related to dart that realm, somethink like Symbol cannot look up for properties not in the same file/library ? I'm not a dart/flutter specialist, so I prefer to fill a bug here to report the issue to you.
And on a related note, you cannot use List as a type, just Iterable. Imho, it's something to improve, at least to keep consistency with other relation that use List.
Regarding cross file backlinks, then this is indeed a bug in the generator, and I have pushed a PR to fix it.
Regarding your suggestion to use List<T> over Iterable<T>. A field marked as a Backlink has a number of constraints:
You cannot modify them directly. You change the backlinks by changing the link pointing to the object.
The order of elements is mostly outside your control, and not something to depend on.
The type hierarchy in Dart regarding collections does not allow for a lot of static differentiation, so we chose Iterable over List. There was some discussion about using UnmodifiableListView but it inherits List.
Anyway, this is just for the models. In the generated class the backlink property is RealmResults<T>. This means you can still index into them, get their length efficiently, and subscribe to changes.
What happened?
Hi !
The bug here is that you cannot use a backlink if not in the same file/library.
That may be more related to dart that realm, somethink like Symbol cannot look up for properties not in the same file/library ? I'm not a dart/flutter specialist, so I prefer to fill a bug here to report the issue to you.
And on a related note, you cannot use List as a type, just Iterable. Imho, it's something to improve, at least to keep consistency with other relation that use List.
Repro steps
https://github.com/geosebas/flutter_realm_backlink
Version
0.7.0rc
What Realm SDK flavor are you using?
MongoDB Atlas (i.e. Sync, auth, functions)
What type of application is this?
Flutter Application
Client OS and version
Generation realm
Code snippets
No response
Stacktrace of the exception/crash you're getting
The text was updated successfully, but these errors were encountered: