Annotation constructor

Annotation({
  1. required AnnotationId annotationId,
  2. double alpha = 1.0,
  3. Offset anchor = const Offset(0.5, 1.0),
  4. bool draggable = false,
  5. BitmapDescriptor icon = BitmapDescriptor.defaultAnnotation,
  6. InfoWindow infoWindow = InfoWindow.noText,
  7. LatLng position = const LatLng(0.0, 0.0),
  8. VoidCallback? onTap,
  9. bool visible = true,
  10. double zIndex = -1,
  11. ValueChanged<LatLng>? onDragEnd,
})

Creates a set of annotation configuration options.

Default annotation options.

Specifies a annotation that

  • is fully opaque; alpha is 1.0
  • has default tap handling; consumeTapEvents is false
  • is stationary; draggable is false
  • has a default icon; icon is default Pin Annotation
  • has no info window text; infoWindowText is InfoWindowText.noText
  • is positioned at 0, 0; position is LatLng(0.0, 0.0)
  • is visible; visible is true

Implementation

Annotation({
  required this.annotationId,
  this.alpha = 1.0,
  this.anchor = const Offset(0.5, 1.0),
  this.draggable = false,
  this.icon = BitmapDescriptor.defaultAnnotation,
  this.infoWindow = InfoWindow.noText,
  this.position = const LatLng(0.0, 0.0),
  this.onTap,
  this.visible = true,
  this.zIndex = -1,
  this.onDragEnd,
}) : assert(0.0 <= alpha && alpha <= 1.0);