mirror of
https://github.com/immich-app/immich.git
synced 2026-07-05 20:57:40 +00:00
fix: dispatch menu onPressed manually (#29353)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
6e1143e799
commit
e9d1951858
1 changed files with 8 additions and 1 deletions
|
|
@ -49,14 +49,21 @@ class BaseActionButton extends ConsumerWidget {
|
|||
|
||||
if (menuItem) {
|
||||
final iconColor = this.iconColor;
|
||||
final onPressed = this.onPressed;
|
||||
|
||||
return MenuItemButton(
|
||||
closeOnActivate: false,
|
||||
style: MenuItemButton.styleFrom(
|
||||
alignment: Alignment.centerLeft,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
||||
),
|
||||
leadingIcon: Icon(iconData, color: iconColor, size: 20),
|
||||
onPressed: onPressed,
|
||||
onPressed: onPressed == null
|
||||
? null
|
||||
: () {
|
||||
onPressed();
|
||||
MenuController.maybeOf(context)?.close();
|
||||
},
|
||||
child: Text(label, style: TextStyle(fontSize: 15, color: iconColor)),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue