get method

Optional<Object?>? get(
  1. Object field
)

Retrieves the field specified by field.

Will return null if the field does not exists. Will return Optional(null) if the field exists but is null.

Implementation

Optional<Object?>? get(Object field) {
  final fieldPath = FieldPath.from(field);
  final protoField = _protoField(fieldPath);

  if (protoField == null) return null;

  return Optional(
    ref.firestore._serializer.decodeValue(protoField),
  );
}