realm library

Classes

Indicates that the field it decorates is the inverse end of a relationship.
CancellationToken
A token for controlling the cancellation of Cancellable operations.
Configuration Configuration
Configuration used to create a Realm instance
DBRef<KeyT>
See DBRef This is not technically a BSON type, but a common convention.
Decimal128
Defined<T>
DynamicRealm Realm
Exposes a set of dynamic methods on the Realm object. These don't use strongly typed classes and instead lookup objects by string name.
DynamicRealmObject Realm
Exposes a set of dynamic methods on the RealmObject type. These allow you to access properties by name rather than via the strongly typed API.
EJson<T>
Annotation to mark a class for extended json (ejson) serialization
GeoBox
A box on the earth's surface.
GeoCircle
A circle on the earth's surface.
GeoDistance
An equatorial distance on earth's surface.
GeoPoint
A point on the earth's surface.
GeoPolygon
A polygon on the earth's surface.
GeoShape
A base type for the supported geospatial shapes.
Ignored Annotations
Indicates an ignored property.
Indexed Annotations
Indicates an indexed property.
InMemoryConfiguration Configuration
InMemoryConfiguration is used to open Realm instances that are temporary to running process.
LocalConfiguration Configuration
LocalConfiguration is used to open local Realm instances, that are persisted across runs.
LogCategory
MapTo Annotations
MapTo annotation for class level and class member level.
Migration Realm
A Migration object is passed to you when you migrate your database from one version to another. It contains the properties for the Realm before and after the migration. After the migration is complete, newRealm will become the authoritative version of the file.
MigrationRealm Realm
A class used during a migration callback. It exposes a set of dynamic API as well as the Realm config and schema.
Move
Contains index information about objects that moved within the same collection.
ObjectId
ObjectId
PrimaryKey Annotations
Indicates a primary key property.
Realm Realm
A Realm instance represents a Realm database.
RealmList<T extends Object?> Realm
Instances of this class are live collections and will update as new elements are either added to or deleted from the collection or from the Realm.
RealmListChanges<T extends Object?>
Describes the changes in a Realm list collection since the last time the notification callback was invoked.
RealmLogger
A logger that logs messages from the Realm SDK.
RealmMap<T extends Object?>
RealmMap is a collection that contains key-value pairs of <String, T>.
RealmMapChanges<T extends Object?>
Describes the changes in a Realm map collection since the last time the notification callback was invoked.
RealmModel Annotations
Annotation class used to define Realm data model classes and their properties
RealmObjectChanges<T extends RealmObjectBase>
Describes the changes in on a single RealmObject since the last time the notification callback was invoked.
RealmResults<T extends Object?> Realm
Instances of this class are live collections and will update as new elements are either added to or deleted from the Realm that match the underlying query.
RealmResultsChanges<T extends Object?>
Describes the changes in a Realm results collection since the last time the notification callback was invoked.
RealmSchema Configuration
Describes the complete set of classes which may be stored in a Realm
RealmSchemaChanges
Describes the schema changes that occurred on a Realm
RealmSet<T extends Object?>
RealmSet is a collection that contains no duplicate elements.
RealmSetChanges<T extends Object?>
Describes the changes in a Realm set collection since the last time the notification callback was invoked.
RealmValue
A type that can represent any valid realm data type, except embedded objects.
SchemaObject Configuration
A collection of properties describing the underlying schema of a RealmObjectBase.
SchemaProperty Configuration
Describes a property on RealmObjectBase with its name, type and other attributes in the RealmSchema
TimeoutCancellationToken
A CancellationToken that automatically cancels after a given duration.
Transaction
Provides a scope to safely write data to a Realm. Can be created using Realm.beginWrite or Realm.beginWriteAsync.
Undefined<T>
UndefinedOr<T>
Uuid
Represents a RFC 4122 UUID. More generally, any 128-bit byte sequence can be represented by this class, but the semantics for the fields described in the may not apply for other variants.

Enums

BsonKey
See MaxKey and MinKey
EJsonType
IntFormat
LogLevel Realm
Specifies the criticality level above which messages will be logged by the default client logger.
ObjectType Annotations
An enum controlling the base type for a RealmModel.
RealmCollectionType Configuration
All supported Realm collection types.
RealmIndexType
Describes the indexing mode for properties annotated with the @Indexed annotation.
RealmPropertyType Configuration
All supported Realm property types.
RealmValueType
An enum describing the possible types that can be wrapped inside RealmValue
WaitForSyncMode
Behavior when waiting for subscribed objects to be synchronized/downloaded.

Mixins

RealmEntity
RealmObjectBase Realm
An object that is persisted in Realm.

Constants

ejson → const EJson
Annotation to mark a class for extended json (ejson) serialization
encryptionKeySize → const int
undefined → const Undefined

Properties

commonDecoders Map<Type, Function>
Predefined decoders for common types
final
relaxed bool
Whether to use relaxed encoding or not, default is false
getter/setter pair

Functions

fromEJson<T>(EJsonValue? ejson, {T? defaultValue}) → T
Converts ejson to type T.
fromEJsonString<T>(String source) → T
Parses source to EJsonValue and convert to type T.
register<T>(EJsonEncoder<T> encoder, EJsonDecoder<T> decoder, {Iterable<Type>? superTypes}) → void
Register custom EJSON encoder and decoder for a type T. The last registered codec pair for a given type T will be used.
toEJson(Object? value) EJsonValue?
Converts value to EJson
toEJsonString(Object? value) String
Converts value to EJson string

Typedefs

EJsonDecoder<T> = T Function(EJsonValue? ejson)
EJsonEncoder<T> = EJsonValue? Function(T object)
EJsonValue = Object?
GeoRing = List<GeoPoint>
InitialDataCallback = void Function(Realm realm)
The signature of a callback that will be executed only when the Realm is first created.
LogRecord = ({LogCategory category, LogLevel level, String message})
A record of a log message from the Realm SDK.
MigrationCallback = void Function(Migration migration, int oldSchemaVersion)
The signature of a callback that will be executed when the schema of the Realm changes.
ShouldCompactCallback = bool Function(int totalSize, int usedSize)
The signature of a callback used to determine if compaction should be attempted.

Exceptions / Errors

CancelledException
InvalidEJson
Thrown when a value cannot be decoded from ejson.
MissingDecoder
Thrown when no decoder is registered for a type.
MissingEncoder
Exception thrown when no encoder is registered for the type of a value.
RealmClosedError Realm
An error throw when operating on an object that has been closed.
RealmError Realm
A base class of all Realm errors.
RealmException Realm
An exception being thrown when a Realm operation or RealmObject access fails.
RealmStateError
Thrown if the Realm operation is not allowed by the current state of the object.
RealmUnsupportedSetError Realm
Thrown if the operation is not supported.
UserCallbackException Realm
An exception throws during execution of a user callback - e.g. during migration or initial data population.