2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-05-09 10:48:54 +00:00

Selectively show certain buttons in the StockItem FAB menu

This commit is contained in:
Oliver Walters 2020-04-08 12:24:32 +10:00
parent 04b09b5591
commit a64f46d79c

View File

@ -173,25 +173,28 @@ class _StockItemDisplayState extends State<StockDetailWidget> {
List<SpeedDialChild> actionButtons() { List<SpeedDialChild> actionButtons() {
var buttons = List<SpeedDialChild>(); var buttons = List<SpeedDialChild>();
buttons.add(SpeedDialChild( // The following actions only apply if the StockItem is not serialized
child: Icon(Icons.add_circle), if (!item.isSerialized()) {
label: "Add Stock", buttons.add(SpeedDialChild(
onTap: null, child: Icon(Icons.add_circle),
label: "Add Stock",
onTap: null,
) )
); );
buttons.add(SpeedDialChild( buttons.add(SpeedDialChild(
child: Icon(Icons.remove_circle), child: Icon(Icons.remove_circle),
label: "Remove Stock", label: "Remove Stock",
onTap: null, onTap: null,
), ),
); );
buttons.add(SpeedDialChild( buttons.add(SpeedDialChild(
child: Icon(Icons.check_circle), child: Icon(Icons.check_circle),
label: "Count Stock", label: "Count Stock",
onTap: null, onTap: null,
)); ));
}
buttons.add(SpeedDialChild( buttons.add(SpeedDialChild(
child: Icon(Icons.location_on), child: Icon(Icons.location_on),