This commit is contained in:
JMARyA 2024-09-08 00:51:18 +02:00
parent 86fb3d6370
commit bb4fab6a11
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
3 changed files with 41 additions and 3 deletions
lib/pages

View file

@ -34,7 +34,7 @@ class _ItemViewState extends State<ItemView> {
widget.item.name,
style: const TextStyle(fontWeight: FontWeight.bold),
),
Text(widget.item.category)
Text(widget.item.category),
],
)
],
@ -42,7 +42,29 @@ class _ItemViewState extends State<ItemView> {
const SizedBox(height: 10),
Row(
children: widget.item.variants.entries.map((entry) {
return Text(entry.value.name);
return Column(children: [
Text(
entry.value.name,
style: TextStyle(fontWeight: FontWeight.bold),
),
FutureBuilder(
future: API().getStat(widget.item.id, entry.key),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return CircularProgressIndicator();
}
var stat = snapshot.data!;
return Column(
children: [
Text("Amount: ${stat.amount}"),
Text("Total Cost: ${stat.total_price}")
],
);
},
)
]);
}).toList()),
FutureBuilder(
future: API().getInventory(widget.item.id),