mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-08 15:08:18 -07:00
feat: Improved floating player bar
This commit is contained in:
parent
82e09b3e0c
commit
013722fc96
8 changed files with 338 additions and 210 deletions
|
|
@ -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}) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue