foreground<T> static method
AnnotationLayer<T>
foreground<T>(
- NodeFlowController<
T> controller, { - void onAnnotationTap(
- Annotation annotation
- void onAnnotationDoubleTap(
- Annotation annotation
- void onAnnotationContextMenu(
- Annotation annotation,
- Offset globalPosition
- void onAnnotationMouseEnter(
- Annotation annotation
- void onAnnotationMouseLeave(
- 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,
);
}