ShadContextMenuItem class
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ShadContextMenuItem
- Available extensions
Constructors
-
ShadContextMenuItem({Key? key, required Widget child, List<
Widget> items = const [], bool enabled = true, Widget? leading, Widget? trailing, EdgeInsetsGeometry? leadingPadding, EdgeInsetsGeometry? trailingPadding, EdgeInsetsGeometry? padding, VoidCallback? onPressed, ValueChanged<TapDownDetails> ? onTapDown, ShadAnchorBase? anchor, Duration? showDelay, double? height, ShadButtonVariant? buttonVariant, ShadDecoration? decoration, TextStyle? textStyle, TextStyle? trailingTextStyle, BoxConstraints? constraints, EdgeInsetsGeometry? subMenuPadding, Color? backgroundColor, Color? selectedBackgroundColor, bool? closeOnTap}) -
const
-
ShadContextMenuItem.inset({Key? key, required Widget child, List<
Widget> items = const [], bool enabled = true, Widget? leading, Widget? trailing, EdgeInsetsGeometry? leadingPadding, EdgeInsetsGeometry? trailingPadding, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? insetPadding, VoidCallback? onPressed, ValueChanged<TapDownDetails> ? onTapDown, ShadAnchorBase? anchor, Duration? showDelay, double? height, ShadButtonVariant? buttonVariant, ShadDecoration? decoration, TextStyle? textStyle, TextStyle? trailingTextStyle, BoxConstraints? constraints, EdgeInsetsGeometry? subMenuPadding, Color? backgroundColor, Color? selectedBackgroundColor, bool? closeOnTap}) -
const
-
ShadContextMenuItem.raw({Key? key, required ShadContextMenuItemVariant variant, required Widget child, List<
Widget> items = const [], bool enabled = true, Widget? leading, Widget? trailing, EdgeInsetsGeometry? leadingPadding, EdgeInsetsGeometry? trailingPadding, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? insetPadding, VoidCallback? onPressed, ValueChanged<TapDownDetails> ? onTapDown, ShadAnchorBase? anchor, Duration? showDelay, double? height, ShadButtonVariant? buttonVariant, ShadDecoration? decoration, TextStyle? textStyle, TextStyle? trailingTextStyle, BoxConstraints? constraints, EdgeInsetsGeometry? subMenuPadding, Color? backgroundColor, Color? selectedBackgroundColor, bool? closeOnTap}) -
const
Properties
- anchor → ShadAnchorBase?
-
The anchor of the context menu item, defaults to
final
- backgroundColor → Color?
-
The background color of the context menu item, defaults to
null.final -
The variant of the button of the context menu item, defaults to
ShadButtonVariant.ghost.
final
- child → Widget
-
The child of the context menu item.
final
- closeOnTap → bool?
-
Whether the context menu should be closed when the item is tapped,
defaults to
truewhen items is empty, otherwisefalse.final - constraints → BoxConstraints?
-
The constraints of the context menu, defaults to
BoxConstraints(minWidth: 128).final - decoration → ShadDecoration?
-
The decoration of the context menu item, defaults to
ShadDecoration(secondaryBorder: ShadBorder.none).final - enabled → bool
-
Whether the context menu item is enabled, defaults to true.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
The height of the context menu item, defaults to 32.
final
- insetPadding → EdgeInsetsGeometry?
-
The padding of the context menu item when it is inset, defaults to
EdgeInsets.only(left: 32, right: 8)when the variant is inset, otherwiseEdgeInsets.symmetric(horizontal: 8)final -
items
→ List<
Widget> -
The submenu items of the context menu item.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- leading → Widget?
-
The leading widget of the context menu item.
final
- leadingPadding → EdgeInsetsGeometry?
-
The padding of the leading widget, defaults to
EdgeInsets.only(right: 8).final - onPressed → VoidCallback?
-
The callback called when the context menu item is pressed.
final
-
onTapDown
→ ValueChanged<
TapDownDetails> ? -
The callback called when a pointer down event is detected on the context
menu item. Useful when the action must fire immediately before the
overlay is dismissed (e.g. text selection context menus).
final
- padding → EdgeInsetsGeometry?
-
The padding of the context menu item, defaults to
EdgeInsets.symmetric(horizontal: 4).final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedBackgroundColor → Color?
-
The background color of the context menu item when it is selected,
defaults to
theme.colorScheme.accent.final - showDelay → Duration?
-
The delay before the context menu is shown, defaults to 100ms.
final
- subMenuPadding → EdgeInsetsGeometry?
-
The padding of the context menu, defaults to
EdgeInsets.symmetric(vertical: 4).final - textStyle → TextStyle?
-
The text style of the context menu item, defaults to
small.copyWith(fontWeight: FontWeight.normal).final - trailing → Widget?
-
The trailing widget of the context menu item.
final
- trailingPadding → EdgeInsetsGeometry?
-
The padding of the trailing widget, defaults to
EdgeInsets.only(left: 8).final - trailingTextStyle → TextStyle?
-
The text style of the trailing widget, defaults to
muted.copyWith(fontSize: 12, height: 1).final - variant → ShadContextMenuItemVariant
-
The variant of the context menu item, defaults to
ShadContextMenuItemVariant.primary.
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 toAnimate(child: myWidget). -
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< ShadContextMenuItem> -
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