CLPopupMenu class

Popup menu riusabile con lo stesso stile delle tableActions della PagedDataTable.

Uso:

CLPopupMenu.show(
  context: context,
  anchorKey: _myGlobalKey,
  title: 'Azioni',
  items: [ CLPopupMenuItem(...) ],
);

Oppure come trigger widget:

CLPopupMenu(
  title: 'Azioni',
  items: [...],
  builder: (context, open) => IconButton(onPressed: open, icon: ...),
);
Inheritance
Available extensions

Constructors

CLPopupMenu({Key? key, String? title, Widget? titleWidget, required List<CLPopupMenuItem> items, required Widget builder(BuildContext context, VoidCallback open), CLPopupAlignment alignment = CLPopupAlignment.end, double minWidth = 0, double maxWidth = 280})
const

Properties

alignment CLPopupAlignment
Allineamento orizzontale del popup rispetto all'anchor. Default: CLPopupAlignment.end (allineato a destra).
final
builder Widget Function(BuildContext context, VoidCallback open)
Builder per il widget trigger. Riceve la callback per aprire il menu.
final
hashCode int
The hash code for this object.
no setterinherited
items List<CLPopupMenuItem>
Lista di voci del menu.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxWidth double
Larghezza massima del popup.
final
minWidth double
Larghezza minima del popup.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title String?
Titolo opzionale nell'header del popup.
final
titleWidget Widget?
Widget personalizzato per l'header (alternativo a title).
final

Methods

animateOnActionTrigger(AnimationInfo animationInfo, {bool hasBeenTriggered = false}) Widget

Available on Widget, provided by the AnimatedWidgetExtension extension

animateOnPageLoad(AnimationInfo animationInfo) Widget

Available on Widget, provided by the AnimatedWidgetExtension extension

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

show({required BuildContext context, required GlobalKey<State<StatefulWidget>> anchorKey, required List<CLPopupMenuItem> items, String? title, Widget? titleWidget, CLPopupAlignment alignment = CLPopupAlignment.end, double minWidth = 0, double maxWidth = 280}) Future<void>
Mostra il popup in modo imperativo dato un GlobalKey come anchor.
showAt({required BuildContext context, required Offset globalPosition, required List<CLPopupMenuItem> items, String? title, double minWidth = 0, double maxWidth = 280}) Future<void>
Mostra il popup a una posizione GLOBALE arbitraria (cursore), non ancorato a un widget. Usato dai menu contestuali (tasto destro). Riusa _showPopup con anchorSize: Size.zero; su mobile (<600) resta il bottom sheet.