toDatastoreValue method

  1. @override
Object? toDatastoreValue(
  1. String kind,
  2. String fieldName,
  3. Object? value, {
  4. bool forComparison = false,
})
override

Converts value according to the Property named name in type.

Implementation

@override
Object? toDatastoreValue(String kind, String fieldName, Object? value,
    {bool forComparison = false}) {
  var modelDescription = _kind2ModelDesc[kind];
  if (modelDescription == null) {
    throw ArgumentError('The kind "$kind" is unknown.');
  }
  return modelDescription.encodeField(this, fieldName, value,
      forComparison: forComparison);
}