ShadContextMenuRegion class

A widget that shows the context menu when the user right clicks the child or long presses it (only on android and ios), unless a value to longPressEnabled is provided.

On Android and iOS, tapping the child also shows the context menu by default. This can be overridden using tapEnabled.

Inheritance
Available extensions

Constructors

ShadContextMenuRegion({Key? key, required Widget child, required List<Widget> items, bool? visible, BoxConstraints? constraints, ValueChanged<bool>? onHoverArea, EdgeInsetsGeometry? padding, Object? groupId, List<Effect>? effects, List<BoxShadow>? shadows, ShadDecoration? decoration, ImageFilter? filter, ShadContextMenuController? controller, Set<PointerDeviceKind>? supportedDevices, bool? longPressEnabled, bool? tapEnabled, HitTestBehavior hitTestBehavior = HitTestBehavior.opaque, Duration? popoverReverseDuration})
A widget that shows the context menu when the user right clicks the child or long presses it (only on android and ios), unless a value to longPressEnabled is provided.
const

Properties

child Widget
The child that triggers the visibility of the context menu.
final
constraints BoxConstraints?
The constraints of the context menu, defaults to BoxConstraints(minWidth: 128).
final
controller ShadContextMenuController?
The controller of the context menu, starts from isOpen set to false.
final
decoration ShadDecoration?
The decoration of the popover.
final
effects List<Effect>?
The animation effects applied to the popover. Defaults to FadeEffect(), ScaleEffect(begin: Offset(.95, .95), end: Offset(1, 1)), MoveEffect(begin: Offset(0, 2), end: Offset(0, 0)).
final
filter ImageFilter?
The filter of the popover. If null, falls back to ShadPopoverTheme.
final
groupId Object?
An optional group ID that groups ShadMouseAreas together so that they operate as one region. If any member of a group is hit by a particular hover, then all members will have their onEnter or onExit called.
final
hashCode int
The hash code for this object.
no setterinherited
hitTestBehavior HitTestBehavior
How this gesture detector should behave during hit testing.
final
items List<Widget>
The items of the context menu.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
longPressEnabled bool?
Whether the context menu should be shown when the user long presses the child, defaults to true only on Android and iOS.
final
onHoverArea ValueChanged<bool>?
The callback called when the hover area changes.
final
padding EdgeInsetsGeometry?
The padding of the context menu, defaults to EdgeInsets.symmetric(vertical: 4).
final
popoverReverseDuration Duration?
The duration of the popover's exit animation.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shadows List<BoxShadow>?
The shadows applied to the popover, defaults to ShadShadows.md.
final
supportedDevices Set<PointerDeviceKind>?
The kind of devices that are allowed to be recognized.
final
tapEnabled bool?
Whether the context menu should be shown when the user taps/left-clicks the child.
final
visible bool?
Whether the context menu is visible, defaults to null.
final

Methods

animate({Key? key, List<Effect>? effects, AnimateCallback? onInit, AnimateCallback? onPlay, AnimateCallback? onComplete, bool? autoPlay, Duration? delay, AnimationController? controller, Adapter? adapter, double? target, double? value}) Animate

Available on Widget, provided by the AnimateWidgetExtensions extension

Wraps the target Widget in an Animate instance, and returns the instance for chaining calls. Ex. myWidget.animate() is equivalent to Animate(child: myWidget).
createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<ShadContextMenuRegion>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
positionedWith(ShadPosition position) Widget

Available on Widget, provided by the PositionedExt extension

toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited