Realm class Null safety Realm
A Realm instance represents a Realm
database.
Constructors
- Realm(Configuration config)
-
Opens a
Realm
using a Configuration object.
Properties
- config → Configuration
-
The Configuration object used to open this Realm
final
- hashCode → int
-
The hash code for this object.
read-only, inherited
- isClosed → bool
-
Checks whether the
Realm
is closed.read-only - isInTransaction → bool
-
Checks whether the
Realm
is in write transaction.read-only - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
- subscriptions → SubscriptionSet
-
The active SubscriptionSet for this Realm
read-only
- syncSession → Session
-
The Session for this Realm. The sync session is responsible for two-way synchronization
with MongoDB Atlas. If the Realm is not synchronized, accessing this property will throw.
read-only
Methods
-
add<
T extends RealmObject> (T object) → T -
Adds a RealmObject to the
Realm
. -
addAll<
T extends RealmObject> (Iterable< T> items) → void -
Adds a collection RealmObjects to this
Realm
. -
all<
T extends RealmObject> () → RealmResults< T> -
Returns all RealmObjects of type
T
in theRealm
-
close(
) → void -
Closes the
Realm
. -
delete<
T extends RealmObject> (T object) → void -
Deletes a RealmObject from this
Realm
. -
deleteAll<
T extends RealmObject> () → void -
Deletes all RealmObjects of type
T
in theRealm
-
deleteMany<
T extends RealmObject> (Iterable< T> items) → void -
Deletes many RealmObjects from this
Realm
. -
find<
T extends RealmObject> (Object primaryKey) → T? -
Fast lookup for a RealmObject with the specified
primaryKey
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
query<
T extends RealmObject> (String query, [List< Object> args = const []]) → RealmResults<T> - Returns all RealmObjects that match the specified query.
-
toString(
) → String -
A string representation of this object.
inherited
-
write<
T> (T writeCallback()) → T - Synchronously calls the provided callback inside a write transaction.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Properties
Static Methods
-
deleteRealm(
String path) → void -
Deletes all files associated with a
Realm
located at givenpath
-
exists(
String path) → Future< bool> -
Checks whether a
Realm
exists atpath
. -
existsSync(
String path) → bool -
Synchronously checks whether a
Realm
exists atpath
-
shutdown(
) → void - Used to shutdown Realm and allow the process to correctly release native resources and exit.