DevConnectRealm class

Auto-reporting wrapper for Realm database operations.

Since Realm is not a hard dependency, this uses duck-typing (dynamic).

final realmWrapper = DevConnectRealm.wrap(realm);

// Writes — auto-reports
realmWrapper.write('User', () {
  realm.add(User('John'));
});

// Queries — auto-reports
final users = realmWrapper.query('User', () => realm.all<User>().toList());

// Deletes — auto-reports
realmWrapper.delete('User', () {
  realm.delete(user);
});

Properties

hashCode → int
The hash code for this object.
no setterinherited
inner → dynamic
Access the underlying Realm instance for direct operations.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

delete<T>(String className, T block(), {dynamic id}) → T
Wrap a delete operation.
deleteAsync<T>(String className, Future<T> block(), {dynamic id}) → Future<T>
Wrap an async delete operation.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
query<T>(String className, T block(), {String? filter, int? resultCount}) → T
Wrap a query/read operation.
queryAsync<T>(String className, Future<T> block(), {String? filter, int? resultCount}) → Future<T>
Wrap an async query/read operation.
read<T>(String className, T block(), {String? filter, int? resultCount}) → T
Wrap a read operation. Alias for query.
readAsync<T>(String className, Future<T> block(), {String? filter, int? resultCount}) → Future<T>
Wrap an async read operation. Alias for queryAsync.
toString() → String
A string representation of this object.
inherited
transaction(String description, {int? affectedObjects}) → void
Report a transaction with count of affected objects.
write<T>(String className, T block(), {Map<String, dynamic>? data}) → T
Wrap a write/create/update operation.
writeAsync<T>(String className, Future<T> block(), {Map<String, dynamic>? data}) → Future<T>
Wrap an async write/create/update operation.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

wrap(dynamic realm) → DevConnectRealm
Wrap a Realm instance for auto-reporting.