SContextMenu class

Inheritance
Available extensions

Constructors

SContextMenu({Key? key, required Widget child, List<SContextMenuItem> buttons = const [], bool followAnchor = false, Duration showThrottle = const Duration(milliseconds: 70), bool announceAccessibility = true, String semanticsMenuLabel = 'Context menu', VoidCallback? onOpened, VoidCallback? onDismissed, void onTapOutsideMenu(Object? tapRegionGroupId)?, void onButtonPressed(String label)?, SContextMenuTheme? theme, bool? showArrow, bool allowMultipleMenus = false, double? backgroundOpacity, Color? highlightColor, Object? tapRegionGroupId, bool shouldPreventWebBrowserContextMenu = kIsWeb})
const

Properties

allowMultipleMenus → bool
When true, more than one context menu instance may remain open simultaneously. Default is false (single-instance mode where opening a new menu dismisses all others).
final
announceAccessibility → bool
final
backgroundOpacity → double?
final
buttons → List<SContextMenuItem>
final
child → Widget
final
followAnchor → bool
final
hashCode → int
The hash code for this object.
no setterinherited
highlightColor → Color?
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onButtonPressed → void Function(String label)?
final
onDismissed → VoidCallback?
final
onOpened → VoidCallback?
final
onTapOutsideMenu → void Function(Object? tapRegionGroupId)?
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
semanticsMenuLabel → String
final
shouldPreventWebBrowserContextMenu → bool
final
showArrow → bool?
Optional override for arrow visibility.
final
showThrottle → Duration
final
tapRegionGroupId → Object?
Optional tap-region group ID for the context menu overlay.
final
theme → SContextMenuTheme?
final

Methods

addMaterialWidget() → Material

Available on Widget, provided by the GenericExtensions extension

addTooltipWidget(String toolTip) → Tooltip

Available on Widget, provided by the GenericExtensions extension

borderRadius([BorderRadiusGeometry? borderRadius]) → Widget

Available on Widget, provided by the GenericExtensions extension

boxDecoration([BoxDecoration? boxDecoration]) → Widget

Available on Widget, provided by the GenericExtensions extension

colorFilter([ColorFilter? colorFilter]) → Widget

Available on Widget, provided by the GenericExtensions extension

set parent widget in center
createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<SContextMenu>
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
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

Static Properties

defaultButtonIcon → IconData
no setter
defaultButtonLabel → String
no setter
hasAnyOpenMenus → bool
Returns true if ANY menu is open (works for both single and multi modes).
no setter
hasOpenMenu → bool
Returns true if there is a currently tracked "active" menu (the most recently opened menu in single-instance mode, or the last one opened in multi-open mode).
no setter

Static Methods

closeAllOpenMenus() → void
Closes all open menus, regardless of single or multi mode. Safe to call at app shutdown, navigation changes, or global dismiss gestures.
closeOpenMenu() → void
Closes only the currently active menu (if any). In multi-open mode other menus stay.
preventBrowserContextMenu() → void