- @override
Converts a value from a more complex value into a primitive value according to this instance's definition.
This method takes a Dart representation of a value and converts it to something that can be used elsewhere (e.g. an HTTP body or database query). How this value is computed depends on this instance's definition.
Source
@override dynamic convertToPrimitiveValue(dynamic value) { if (value is ManagedSet) { return value .map((ManagedObject innerValue) => innerValue.asMap()) .toList(); } else if (value is ManagedObject) { return value.asMap(); } else if (value == null) { return null; } throw new QueryException(QueryExceptionEvent.requestFailure, message: "Invalid value '$value' for property '$entity.$name', " "expected '${MirrorSystem.getName(destinationEntity.instanceType.simpleName)}'"); }