ContextMenuWrapper class

A wrapper widget that simplifies the usage of the context menu. It listens for a long press and automatically shows the menu.

Inheritance

Constructors

ContextMenuWrapper({Key? key, required Widget child, required List<ContextMenuItem> actions, bool? isDark, TextStyle? textStyle, Color? backgroundColor, Color? backgroundMenuColor, Color? dividerColor, Color? iconColor, AlignmentGeometry? menuAlignment, EdgeInsetsGeometry? contentPadding, double? textSize, double? iconSize, double? blurSigma})
const

Properties

actions List<ContextMenuItem>
The list of actions to show in the menu.
final
backgroundColor Color?
Optional: Background color of the whole overlay.
final
backgroundMenuColor Color?
Optional: Background color of the menu container.
final
blurSigma double?
Optional: Intensity of the blur.
final
child Widget
The widget that triggers the context menu.
final
contentPadding EdgeInsetsGeometry?
Optional: Padding around the content.
final
dividerColor Color?
Optional: Divider color between menu items.
final
hashCode int
The hash code for this object.
no setterinherited
iconColor Color?
Optional: Icon color.
final
iconSize double?
Optional: Icon size.
final
isDark bool?
Optional: Force dark mode.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
Optional: Alignment of the menu.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
textSize double?
Optional: Font size for text.
final
textStyle TextStyle?
Optional: Custom text style for action labels.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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
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