-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
135 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import 'package:realm_common/realm_common.dart'; | ||
import 'mapto.dart'; | ||
|
||
part 'another_mapto.realm.dart'; | ||
|
||
@RealmModel() | ||
@MapTo('this is also mapped') | ||
class _MappedToo { | ||
late $Original? singleLink; | ||
|
||
late List<$Original> listLink; | ||
} |
55 changes: 55 additions & 0 deletions
55
generator/test/good_test_data/another_mapto.expected_multi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// GENERATED CODE - DO NOT MODIFY BY HAND | ||
|
||
part of 'another_mapto.dart'; | ||
|
||
// ************************************************************************** | ||
// RealmObjectGenerator | ||
// ************************************************************************** | ||
|
||
class MappedToo extends _MappedToo | ||
with RealmEntity, RealmObjectBase, RealmObject { | ||
MappedToo({ | ||
Original? singleLink, | ||
Iterable<Original> listLink = const [], | ||
}) { | ||
RealmObjectBase.set(this, 'singleLink', singleLink); | ||
RealmObjectBase.set<RealmList<Original>>( | ||
this, 'listLink', RealmList<Original>(listLink)); | ||
} | ||
|
||
MappedToo._(); | ||
|
||
@override | ||
Original? get singleLink => | ||
RealmObjectBase.get<Original>(this, 'singleLink') as Original?; | ||
@override | ||
set singleLink(covariant Original? value) => | ||
RealmObjectBase.set(this, 'singleLink', value); | ||
|
||
@override | ||
RealmList<Original> get listLink => | ||
RealmObjectBase.get<Original>(this, 'listLink') as RealmList<Original>; | ||
@override | ||
set listLink(covariant RealmList<Original> value) => | ||
throw RealmUnsupportedSetError(); | ||
|
||
@override | ||
Stream<RealmObjectChanges<MappedToo>> get changes => | ||
RealmObjectBase.getChanges<MappedToo>(this); | ||
|
||
@override | ||
MappedToo freeze() => RealmObjectBase.freezeObject<MappedToo>(this); | ||
|
||
static SchemaObject get schema => _schema ??= _initSchema(); | ||
static SchemaObject? _schema; | ||
static SchemaObject _initSchema() { | ||
RealmObjectBase.registerFactory(MappedToo._); | ||
return const SchemaObject( | ||
ObjectType.realmObject, MappedToo, 'this is also mapped', [ | ||
SchemaProperty('singleLink', RealmPropertyType.object, | ||
optional: true, linkTarget: 'another type'), | ||
SchemaProperty('listLink', RealmPropertyType.object, | ||
linkTarget: 'another type', collectionType: RealmCollectionType.list), | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// MOCK FILE! | ||
part of 'another_mapto.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters