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
I wonder how to include custom objects on Realm class which I could found nowhere on the doc.
Repro steps
@RealmModel()
class_CustomField{
// The tag if the custom field is a single string or a double string.latefinalString type;
// The single field.latefinalString? single;
// The double fields.latefinalString? our;
latefinalString? their;
}
The codes above runs with no error. Then I tried
@RealmModel()
class_CustomField{
// The tag if the custom field is a single string or a double string.latefinalString type;
// The single field.latefinalString? single;
// The double fields.latefinalString? our;
latefinalString? their;
}
@RealmModel()
class_CustomFields{
lateList<CustomField> customFields;
}
Now it complains List<CustomField> is not a realm model type. Even without List the issue exists.
ChatGPT told me to add a label @RealmEmbedded but it doesn't seem to work. Dart language server complains Undefined name 'RealmEmbedded' used as an annotation. Try defining the name or importing it from another library. The script complains Could not resolve annotation for 'class _CustomField'.
What's more: What would it happen if I try to use an abstract class object as a data field of a Realm object? How to express things like Rust enums or C/C++ unions?
Version
Dart 3.5.1 Flutter 3.24.1
What Atlas Services are you using?
Local Database only
What type of application is this?
Flutter Application
Client OS and version
Windows 11 21H2
Code snippets
No response
Stacktrace of the exception/crash you're getting
Relevant log output
The text was updated successfully, but these errors were encountered:
What happened?
I wonder how to include custom objects on Realm class which I could found nowhere on the doc.
Repro steps
The codes above runs with no error. Then I tried
Now it complains
List<CustomField> is not a realm model type
. Even withoutList
the issue exists.ChatGPT told me to add a label
@RealmEmbedded
but it doesn't seem to work. Dart language server complainsUndefined name 'RealmEmbedded' used as an annotation. Try defining the name or importing it from another library.
The script complainsCould not resolve annotation for 'class _CustomField'.
What's more: What would it happen if I try to use an abstract class object as a data field of a Realm object? How to express things like Rust enums or C/C++ unions?
Version
Dart 3.5.1 Flutter 3.24.1
What Atlas Services are you using?
Local Database only
What type of application is this?
Flutter Application
Client OS and version
Windows 11 21H2
Code snippets
No response
Stacktrace of the exception/crash you're getting
Relevant log output
The text was updated successfully, but these errors were encountered: