A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pub.dev/documentation/realm_common/latest/realm_common/RealmValue-class.html below:

RealmValue class - realm_common library

RealmValue class

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
as<T>() → T
Casts value to T. An exception will be thrown if the value is not convertible to T.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.

inherited

toString() String
A string representation of this object.

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