From 7ee1cda550c70b6f541fb62c67433d8c83765344 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Fri, 18 Oct 2024 11:02:28 +0200 Subject: [PATCH] image --- lib/api.dart | 2 ++ lib/pages/itemview.dart | 13 ++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/api.dart b/lib/api.dart index 1ae5dc6..86c9678 100644 --- a/lib/api.dart +++ b/lib/api.dart @@ -361,12 +361,14 @@ class FlowInfo { class Item { late String id; + late String? image; late String name; late String? category; late Map variants; Item(Map json) { id = json["uuid"]; + image = json["image"]; name = json["name"]; category = json["category"]; variants = {}; diff --git a/lib/pages/itemview.dart b/lib/pages/itemview.dart index a6e7363..8ea7415 100644 --- a/lib/pages/itemview.dart +++ b/lib/pages/itemview.dart @@ -43,12 +43,15 @@ class _ItemViewState extends State { Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - const Align( + Align( alignment: Alignment.centerLeft, - child: Placeholder( - fallbackWidth: 100, - fallbackHeight: 100, - ), + child: widget.item.image != null + ? Image.network( + "${API().instance}/${widget.item.image}", + height: 100, + width: 100, + ) + : null, ), const SizedBox( width: 16.0,