background<T> static method

AnnotationLayer<T> background<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 background annotation layer.

Renders annotations with AnnotationRenderLayer.background behind nodes, such as GroupAnnotation.

Example

Stack(
  children: [
    Background(),
    AnnotationLayer<T>.background(controller), // Groups behind nodes
    Nodes(),
    Connections(),
  ],
)

Implementation

static AnnotationLayer<T> background<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.background,
    onAnnotationTap: onAnnotationTap,
    onAnnotationDoubleTap: onAnnotationDoubleTap,
    onAnnotationContextMenu: onAnnotationContextMenu,
    onAnnotationMouseEnter: onAnnotationMouseEnter,
    onAnnotationMouseLeave: onAnnotationMouseLeave,
  );
}