Give favorite button only for local photos

This commit is contained in:
Vishnu Mohandas 2020-05-25 21:35:06 +05:30
parent 27519273e5
commit 96ce1f5908

View file

@ -88,16 +88,18 @@ class _DetailPageState extends State<DetailPage> {
}
AppBar _buildAppBar() {
final actions = List<Widget>();
if (widget.photos[_selectedIndex].localId != null) {
actions.add(_getFavoriteButton());
}
actions.add(IconButton(
icon: Icon(Icons.share),
onPressed: () async {
share(_photos[_selectedIndex]);
},
));
return AppBar(
actions: <Widget>[
_getFavoriteButton(),
IconButton(
icon: Icon(Icons.share),
onPressed: () async {
share(_photos[_selectedIndex]);
},
)
],
actions: actions,
);
}