feat: Improved floating player bar

This commit is contained in:
PartyDonut 2025-07-31 16:24:41 +02:00
parent 82e09b3e0c
commit 013722fc96
8 changed files with 338 additions and 210 deletions

View file

@ -10,6 +10,7 @@ abstract class ItemAction {
PopupMenuEntry toPopupMenuItem({bool useIcons = false});
Widget toLabel();
Widget toListItem(BuildContext context, {bool useIcons = false, bool shouldPop = true});
Widget toButton();
}
class ItemActionDivider extends ItemAction {
@ -26,6 +27,9 @@ class ItemActionDivider extends ItemAction {
@override
Widget toListItem(BuildContext context, {bool useIcons = false, bool shouldPop = true}) => const Divider();
@override
Widget toButton() => Container();
}
class ItemActionButton extends ItemAction {
@ -51,9 +55,10 @@ class ItemActionButton extends ItemAction {
}
@override
MenuItemButton toMenuItemButton() {
return MenuItemButton(leadingIcon: icon, onPressed: action, child: label);
}
MenuItemButton toMenuItemButton() => MenuItemButton(leadingIcon: icon, onPressed: action, child: label);
@override
Widget toButton() => IconButton(onPressed: action, icon: icon ?? const SizedBox.shrink());
@override
PopupMenuItem toPopupMenuItem({bool useIcons = false}) {