whereNear method Null safety

LCSearchSortBuilder whereNear(
  1. String key,
  2. LCGeoPoint point,
  3. {String? order,
  4. String? mode,
  5. String? unit}
)

Implementation

LCSearchSortBuilder whereNear(String key, LCGeoPoint point, { String? order, String? mode, String? unit }) {
  _fields.add({
    '_geo_distance': {
      key: {
        'lat': point.latitude,
        'lon': point.longitude
      },
      'order': order ?? 'asc',
      'mode': mode ?? 'avg',
      'unit': unit ?? 'km'
    }
  });
  return this;
}