fix price overwrite
This commit is contained in:
parent
370a5329a9
commit
689fa13a7e
1 changed files with 6 additions and 3 deletions
|
@ -99,10 +99,13 @@ class _SupplyPageState extends State<SupplyPage> {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onSelected: (String selection) async {
|
onSelected: (String selection) async {
|
||||||
var price =
|
var price = _price.isEmpty
|
||||||
await API().getLatestPrice(widget.item.id, variant);
|
? await API()
|
||||||
|
.getLatestPrice(widget.item.id, variant)
|
||||||
|
.then((x) => x.value.toStringAsFixed(2))
|
||||||
|
: _price;
|
||||||
setState(() {
|
setState(() {
|
||||||
_price = price.value.toStringAsFixed(2);
|
_price = price;
|
||||||
_selectedOrigin = selection;
|
_selectedOrigin = selection;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue