convertValueToCorrectType function Null safety

dynamic convertValueToCorrectType(
  1. dynamic value
)

Converts the object to the correct value for JSON,

Strings are wrapped with "" but integers and others are not

Implementation

dynamic convertValueToCorrectType(dynamic value) {
  /*if (value is String && !value.contains('__type')) {
    return '\"$value\"';
  }*/

  if (value is DateTime || value is ParseObject) {
    return parseEncode(value);
  } else {
    return value;
  }
}