Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsenko committed Aug 18, 2022
1 parent 27c078f commit de556d3
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/src/realm_property.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,7 @@ class ListProperty<ElementT extends Object?> extends LinkTargetProperty<ElementT
RealmList<ElementT> getValue<ParentT extends RealmObject>(ParentT object) {
return object.accessor.getList<ElementT>(object, this);
}

@override
bool get optional => isNullable<ElementT>();
}
2 changes: 2 additions & 0 deletions test/list_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -361,4 +361,6 @@ Future<void> main([List<String>? args]) async {
final result = team.players.query(r'name BEGINSWITH $0', ['J']);
expect(result, [person]);
});

test('', () {});
}
2 changes: 1 addition & 1 deletion test/realm_object_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ Future<void> main([List<String>? args]) async {
final config = Configuration.local([AllCollections.schema]);
final realm = getRealm(config);
final obj = realm.write(() {
return realm.add(AllCollections(dates: list));
return realm.add(AllCollections(dates: list, nullableDates: [null]));
});

final json = obj.toJson();
Expand Down
8 changes: 8 additions & 0 deletions test/test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@ class _AllCollections {
late List<ObjectId> objectIds;
late List<Uuid> uuids;
late List<int> ints;

late List<String?> nullableStrings;
late List<bool?> nullableBools;
late List<DateTime?> nullableDates;
late List<double?> nullableDoubles;
late List<ObjectId?> nullableObjectIds;
late List<Uuid?> nullableUuids;
late List<int?> nullableInts;
}

@RealmModel()
Expand Down
84 changes: 84 additions & 0 deletions test/test.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit de556d3

Please sign in to comment.