createWithJsonImpl<T extends RLMObject> method
Future<Map>
createWithJsonImpl<T extends RLMObject>(
- dynamic value, {
- UpdatePolicy policy = UpdatePolicy.error,
Create object by given policy.
param
_creator required for make object for given generic type
Implementation
Future<Map<dynamic, dynamic>> createWithJsonImpl<T extends RLMObject>(
dynamic value,
{UpdatePolicy policy = UpdatePolicy.error}) async {
assert(_partition.length != 0);
Map<String, dynamic> values = {
'value': value,
'policy': policy.value,
'identity': _syncUser.identity,
'appId': _appId,
'partition': _partition,
"type": T.toString()
};
Map<dynamic, dynamic> map = await _channel.invokeMethod(
value is List ? Action.createList.name : Action.create.name, values);
if (map["error"] != null) {
throw Exception("create object finished with exception ${map["error"]}");
}
return map;
}