diff --git a/lib/pages/main.page.dart b/lib/pages/main.page.dart index 606df4e..f277325 100644 --- a/lib/pages/main.page.dart +++ b/lib/pages/main.page.dart @@ -659,10 +659,6 @@ class _MainPageState extends ReceiveShareState with WidgetsBindingObse )); } Widget mediaMenuIcon; - mediaMenuItems.add(PopupMenuItem( - child: new Text("Play media..."), - value: "play_media", - )); int playersCount = 0; if (!empty && !HomeAssistant().entities.isEmpty) { List activePlayers = HomeAssistant().entities.getByDomains(domains: ["media_player"], stateFiler: [EntityState.paused, EntityState.playing]); @@ -679,6 +675,12 @@ class _MainPageState extends ReceiveShareState with WidgetsBindingObse )).toList() ); } + mediaMenuItems.addAll([ + PopupMenuItem( + child: new Text("Play media..."), + value: "play_media", + ) + ]); if (playersCount > 0) { mediaMenuIcon = Stack( overflow: Overflow.visible,