foreground<T> static method

AnnotationLayer<T> foreground<T>(
  1. NodeFlowController<T> controller, {
  2. void onAnnotationTap(
    1. Annotation annotation
    )?,
  3. void onAnnotationDoubleTap(
    1. Annotation annotation
    )?,
  4. void onAnnotationContextMenu(
    1. Annotation annotation,
    2. Offset globalPosition
    )?,
  5. void onAnnotationMouseEnter(
    1. Annotation annotation
    )?,
  6. void onAnnotationMouseLeave(
    1. Annotation annotation
    )?,
})

Creates a foreground annotation layer.

Renders annotations with AnnotationRenderLayer.foreground above nodes and connections, such as StickyAnnotation and MarkerAnnotation.

Example

Stack(
  children: [
    Background(),
    Groups(),
    Nodes(),
    Connections(),
    AnnotationLayer<T>.foreground(controller), // Stickies and markers on top
  ],
)

Implementation

static AnnotationLayer<T> foreground<T>(
  NodeFlowController<T> controller, {
  void Function(Annotation annotation)? onAnnotationTap,
  void Function(Annotation annotation)? onAnnotationDoubleTap,
  void Function(Annotation annotation, Offset globalPosition)?
  onAnnotationContextMenu,
  void Function(Annotation annotation)? onAnnotationMouseEnter,
  void Function(Annotation annotation)? onAnnotationMouseLeave,
}) {
  return AnnotationLayer<T>(
    controller: controller,
    filter: (annotation) =>
        annotation.layer == AnnotationRenderLayer.foreground,
    onAnnotationTap: onAnnotationTap,
    onAnnotationDoubleTap: onAnnotationDoubleTap,
    onAnnotationContextMenu: onAnnotationContextMenu,
    onAnnotationMouseEnter: onAnnotationMouseEnter,
    onAnnotationMouseLeave: onAnnotationMouseLeave,
  );
}