Skip to content

Commit

Permalink
Various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
papafe committed Jun 14, 2024
1 parent fcf753d commit f2461a5
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
3 changes: 0 additions & 3 deletions packages/realm_dart/lib/src/list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ abstract class RealmList<T extends Object?> with RealmEntity implements List<T>
/// Creates a frozen snapshot of this `RealmList`.
RealmList<T> freeze();

//TODO Should we have a base collection class so we can move those methods there?
/// Allows listening for changes when the contents of this collection changes.
Stream<RealmListChanges<T>> get changes;

Expand Down Expand Up @@ -211,13 +210,11 @@ class ManagedRealmList<T extends Object?> with RealmEntity, ListMixin<T> impleme
throw RealmStateError('Key paths can be used only with collections of Realm objects');
}

//TODO Also this is just called ListNotificationController, while the set one is called RealmSetNotificationController
final controller = ListNotificationsController<T>(asManaged(), keyPaths);
return controller.createStream();
}
}

//TODO I would move this before the managed, so it's consistent with the maps and list
class UnmanagedRealmList<T extends Object?> extends collection.DelegatingList<T> with RealmEntity implements RealmList<T> {
final List<T> _base;

Expand Down
1 change: 0 additions & 1 deletion packages/realm_dart/lib/src/set.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ class UnmanagedRealmSet<T extends Object?> extends collection.DelegatingSet<T> w
@override
bool get isValid => true;

//TODO We just call lists "lists" (same for maps), while we call sets "RealmSets". We probably need to figure out which one we want to use
@override
Stream<RealmSetChanges<T>> get changes => throw RealmStateError("Unmanaged RealmSets don't support changes");

Expand Down
2 changes: 1 addition & 1 deletion packages/realm_dart/test/realm_object_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ void main() {
subscription.cancel();
});

//TODO Remove skip when of https://github.com/realm/realm-core/issues/7805 is solved
//TODO Remove skip when https://github.com/realm/realm-core/issues/7805 is solved
test('empty list gives no subscriptions', () async {
var config = Configuration.local([TestNotificationObject.schema, TestNotificationEmbeddedObject.schema]);
var realm = getRealm(config);
Expand Down

0 comments on commit f2461a5

Please sign in to comment.