get method

Object? get(
  1. Object field
)

The value of field, a dot-separated String, a FieldPath or a Field; null if the result has no such field.

Implementation

Object? get(Object field) {
  final model.FieldPath path;
  if (field is Field) {
    path = field.path;
  } else if (field is FieldPath) {
    path = field.internalPath;
  } else if (field is String) {
    path = FieldPath.fromString(field).internalPath;
  } else {
    throw ArgumentError(
      'A field must be a String, a FieldPath or a Field, but got: $field',
    );
  }
  final FieldValue? value = _fields.get(path);
  return value == null ? null : _convertValue(value);
}