ElementScope constructor
const
ElementScope({
- Key? key,
- required Widget child,
- required void onDragStart(
- DragStartDetails details
- required void onDragUpdate(
- DragUpdateDetails details
- required void onDragEnd(
- DragEndDetails details
- VoidCallback? onDragCancel,
- DragSession createSession()?,
- bool isDraggable = true,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- VoidCallback? onTap,
- VoidCallback? onDoubleTap,
- void onContextMenu(
- ScreenPosition screenPosition
- VoidCallback? onMouseEnter,
- VoidCallback? onMouseLeave,
- MouseCursor? cursor,
- HitTestBehavior hitTestBehavior = HitTestBehavior.opaque,
- AutoPanConfig? autoPan,
- void onAutoPan(
- Offset delta
- Rect getViewportBounds()?,
- Offset screenToGraph(
- Offset screenPosition
Creates an element scope with the specified interaction callbacks.
The onDragStart, onDragUpdate, and onDragEnd callbacks are required
and form the core drag lifecycle. Other callbacks are optional.
Implementation
const ElementScope({
super.key,
required this.child,
required this.onDragStart,
required this.onDragUpdate,
required this.onDragEnd,
this.onDragCancel,
this.createSession,
this.isDraggable = true,
this.dragStartBehavior = DragStartBehavior.start,
this.onTap,
this.onDoubleTap,
this.onContextMenu,
this.onMouseEnter,
this.onMouseLeave,
this.cursor,
this.hitTestBehavior = HitTestBehavior.opaque,
// Autopan parameters
this.autoPan,
this.onAutoPan,
this.getViewportBounds,
this.screenToGraph,
});