toDatastoreEntity method

  1. @override
Entity toDatastoreEntity(
  1. Model model
)
override

Converts a Model instance to a ds.Entity.

Implementation

@override
ds.Entity toDatastoreEntity(Model model) {
  try {
    var modelDescription = _modelDescriptionForType(model.runtimeType)!;
    return modelDescription.encodeModel(this, model);
  } catch (error, stack) {
    throw ArgumentError('Error while encoding entity ($error, $stack).');
  }
}