ArView class
Constructors
ArView ({Key ? key , required List <ArAnnotation > annotations , required AnnotationViewBuilder annotationViewBuilder , @Deprecated ('Unused. Will be removed in 4.0.0.') Size ? frame , required ChangeLocationCallback onLocationChange , double annotationWidth = 200 , double annotationHeight = 75 , double maxVisibleDistance = 1500 , bool showDebugInfoSensor = true , double paddingOverlap = 5 , double ? yOffsetOverlap , required double minDistanceReload , bool scaleWithDistance = true , double minScale = AnnotationLayoutConfig.defaultMinScale , Color ? markerColor , Color ? backgroundRadar , RadarPosition ? radarPosition , bool showRadar = true , double ? radarWidth , ArSensorSource ? sensorSource , ArSensorErrorBuilder ? sensorErrorBuilder , ValueChanged <ArSensorException > ? onSensorError , double ? cameraFieldOfView , double ? previewAspectRatio , bool useAltitude = false , bool hideWithinLocationAccuracy = false , Duration rowAnimationDuration = const Duration(milliseconds: 200) , int ? maxRows , AnnotationGroupBadgeBuilder ? groupBadgeBuilder })
const
Properties
annotationHeight
→ double
Height, in pixels, of every annotation label.
final
annotations
→ List <ArAnnotation >
POIs to show. Their ArAnnotation.distanceFromUser ,
ArAnnotation.arPosition and related fields are updated in place by
the layout.
final
annotationViewBuilder
→ AnnotationViewBuilder
Builds the label of an annotation, see AnnotationViewBuilder .
final
annotationWidth
→ double
Width, in pixels, of every annotation label.
final
backgroundRadar
→ Color ?
background radar color
final
cameraFieldOfView
→ double ?
Field of view of the back camera along its long side, in degrees. When
null, it is read from the device, falling back to
AnnotationLayoutConfig.defaultCameraFieldOfView .
final
frame
→ Size ?
Unused.
final
groupBadgeBuilder
→ AnnotationGroupBadgeBuilder ?
Badge shown on a label that has annotations grouped into it. Defaults
to a "+N" bubble on its top-right corner; return
const SizedBox.shrink() to hide it.
final
hashCode
→ int
The hash code for this object.
no setter inherited
hideWithinLocationAccuracy
→ bool
Hide POIs closer than the location accuracy, see
AnnotationLayoutConfig.hideWithinLocationAccuracy .
final
key
→ Key ?
Controls how one widget replaces another widget in the tree.
final inherited
markerColor
→ Color ?
Radar
marker color in radar
final
maxRows
→ int ?
Maximum number of stacked rows of labels, see
AnnotationLayoutConfig.maxRows .
final
maxVisibleDistance
→ double
Max distance, in meters, at which a POI is shown (and the range of the
radar).
final
minDistanceReload
→ double
Distance, in meters, the user must move before onLocationChange is
called again.
final
minScale
→ double
Scale of a label at maxVisibleDistance when scaleWithDistance : labels
shrink linearly from 1 next to the user down to this value.
final
onLocationChange
→ ChangeLocationCallback
Called with the first location, then whenever the user moved by more
than minDistanceReload meters.
final
onSensorError
→ ValueChanged <ArSensorException > ?
Called with every error reported by the sensor source, including the
ones sensorErrorBuilder does not show because a location is already
known (e.g. location services turned off while the view is running: the
labels then stay where the last location put them).
final
paddingOverlap
→ double
Vertical gap, in pixels, between two stacked overlapping labels.
final
previewAspectRatio
→ double ?
Aspect ratio (long side / short side) of the camera preview shown behind
this view. Defaults to AnnotationLayoutConfig.defaultPreviewAspectRatio .
final
radarPosition
→ RadarPosition ?
radar position in view
final
radarWidth
→ double ?
Radar width
final
rowAnimationDuration
→ Duration
Duration of the transition when a label moves to another overlap row.
Duration.zero disables the animation.
final
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
scaleWithDistance
→ bool
Scale annotation view with distance from user
final
sensorErrorBuilder
→ ArSensorErrorBuilder ?
Widget shown when the sensor source reports an error (e.g. location
permission denied) before any location is known. Defaults to a short
message.
final
sensorSource
→ ArSensorSource ?
Source of fused sensor/location samples. Defaults to a device-backed
ArSensorManager instantiated per ArView , paused while the app is in
background. Provide your own implementation (e.g. a fake source) to
test without real hardware or to share a single sensor pipeline across
multiple views. A provided source is neither paused nor disposed by
ArView : its owner is responsible for it.
final
showDebugInfoSensor
→ bool
Shows the raw location, pitch and heading at the bottom of the view,
in debug builds only.
final
showRadar
→ bool
Show radar in view
final
useAltitude
→ bool
Place POIs above/below the horizon from their altitude, see
AnnotationLayoutConfig.useAltitude .
final
yOffsetOverlap
→ double ?
Vertical distance, in pixels, between two stacked overlapping labels,
before paddingOverlap . Defaults to annotationHeight .
final