A type that can represent any valid realm data type, except embedded objects.
You can use RealmValue to declare fields on realm models, in which case it must be non-nullable, but it can wrap a null-value. List of RealmValue (List<RealmValue>
) are also legal.
RealmValue fields can be Indexed
@RealmModel()
class _AnythingGoes {
@Indexed()
late RealmValue any;
late List<RealmValue> manyAny;
}
void main() {
final realm = Realm(Configuration.local([AnythingGoes.schema]));
realm.write(() {
final something = realm.add(AnythingGoes(any: RealmValue.string('text')));
something.manyAny.addAll([
null,
true,
'text',
42,
3.14,
].map(RealmValue.from));
});
}
Methods
T
. An exception will be thrown if the value is not convertible to T
.
inherited
override
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4