diff --git a/lib/src/components/submenu.dart b/lib/src/components/submenu.dart index 70a88d7..e041568 100644 --- a/lib/src/components/submenu.dart +++ b/lib/src/components/submenu.dart @@ -22,11 +22,15 @@ class ArDriveSubmenu extends StatefulWidget { required this.child, required this.menuChildren, this.alignmentOffset = Offset.zero, + this.onOpen, + this.onClose, }); final Widget child; final List menuChildren; final Offset alignmentOffset; + final Function? onOpen; + final Function? onClose; @override State createState() => _ArDriveSubmenuState(); @@ -35,19 +39,16 @@ class ArDriveSubmenu extends StatefulWidget { class _ArDriveSubmenuState extends State { final topMenuController = MenuController(); - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { return ArDriveMenuWidget( onClick: () { if (topMenuController.isOpen) { topMenuController.close(); + widget.onClose?.call(); } else { topMenuController.open(); + widget.onOpen?.call(); } }, menuController: topMenuController, diff --git a/pubspec.yaml b/pubspec.yaml index cc1e9f3..ffa931c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: ardrive_ui description: UI Design Library for the ArDrive Design System -version: 1.17.0 +version: 1.17.1 publish_to: "none"