mogol / flutter_realm

Realm via Platform Channels
https://pub.dev/packages/flutter_realm
MIT License
115 stars 18 forks source link

Support for Relations #15

Open bbjay opened 4 years ago

bbjay commented 4 years ago

I get a PlatformException (PlatformException(-1, Unsupported value for standard codec, null)) exception on iOS when i try to fetch all objects, when one object has a one-to-one relation to another object.

It looks like relations need special handling which is not implemented yet, right?

xspyhack commented 4 years ago

Add these two lines code to - (NSDictionary *)toMap method in RLMObject (FlutterRealm) will support relationships

} else if ([self[p.name] isKindOfClass:[RLMObject class]]) {
    map[p.name] = [(RLMObject *)self[p.name] toMap];
}