Resolves #461 Hide media switch buttons if nothing playing

This commit is contained in:
estevez-dev 2019-09-20 16:42:50 +03:00
parent dff6457cb2
commit b988fcfcdd

View File

@ -403,25 +403,26 @@ class _MediaPlayerControlsState extends State<MediaPlayerControls> {
)
);
}
children.add(
ButtonBar(
children: <Widget>[
RaisedButton(
child: Text("Duplicate to"),
color: Colors.blue,
textColor: Colors.white,
onPressed: () => _duplicateTo(entity),
),
RaisedButton(
child: Text("Switch to"),
color: Colors.blue,
textColor: Colors.white,
onPressed: () => _switchTo(entity),
if (entity.state == EntityState.playing || entity.state == EntityState.paused) {
children.add(
ButtonBar(
children: <Widget>[
RaisedButton(
child: Text("Duplicate to"),
color: Colors.blue,
textColor: Colors.white,
onPressed: () => _duplicateTo(entity),
),
RaisedButton(
child: Text("Switch to"),
color: Colors.blue,
textColor: Colors.white,
onPressed: () => _switchTo(entity),
)
],
)
],
)
);
);
}
}
return Column(
children: children,