Hide delete option for files not owned by the user
This commit is contained in:
parent
128c207e55
commit
2b4cbf8131
|
@ -85,6 +85,7 @@ class FadingAppBarState extends State<FadingAppBar> {
|
|||
|
||||
AppBar _buildAppBar() {
|
||||
final List<Widget> actions = [];
|
||||
// only show fav option for files owned by the user
|
||||
if (widget.file.ownerID == null || widget.file.ownerID == widget.userId) {
|
||||
actions.add(_getFavoriteButton());
|
||||
}
|
||||
|
@ -109,22 +110,26 @@ class FadingAppBarState extends State<FadingAppBar> {
|
|||
),
|
||||
);
|
||||
}
|
||||
items.add(
|
||||
PopupMenuItem(
|
||||
value: 2,
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Platform.isAndroid
|
||||
? Icons.delete_outline
|
||||
: CupertinoIcons.delete),
|
||||
Padding(
|
||||
padding: EdgeInsets.all(8),
|
||||
),
|
||||
Text("delete"),
|
||||
],
|
||||
// only show delete option for files owned by the user
|
||||
if (widget.file.ownerID == null ||
|
||||
widget.file.ownerID == widget.userId) {
|
||||
items.add(
|
||||
PopupMenuItem(
|
||||
value: 2,
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Platform.isAndroid
|
||||
? Icons.delete_outline
|
||||
: CupertinoIcons.delete),
|
||||
Padding(
|
||||
padding: EdgeInsets.all(8),
|
||||
),
|
||||
Text("delete"),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
);
|
||||
}
|
||||
return items;
|
||||
},
|
||||
onSelected: (value) {
|
||||
|
|
Loading…
Reference in a new issue