From 0a338589bd76370ea9a78e73b91d076c8ad08b1c Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 19 May 2024 13:20:38 +0300 Subject: [PATCH] Show product image if link is set --- .../product/view/product_view_overview.dart | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/ui/product/view/product_view_overview.dart b/lib/ui/product/view/product_view_overview.dart index 272b7601a21..44acd7aa653 100644 --- a/lib/ui/product/view/product_view_overview.dart +++ b/lib/ui/product/view/product_view_overview.dart @@ -110,10 +110,6 @@ class _ProductOverviewState extends State { formatNumberType: FormatNumberType.int); } - if (product.imageUrl.isNotEmpty) { - fields[localization.imageUrl] = product.imageUrl; - } - return ScrollableListView( children: [ EntityHeader( @@ -127,13 +123,24 @@ class _ProductOverviewState extends State { ), ListDivider(), FieldGrid(fields), - Padding( - padding: EdgeInsets.all(20), - child: Text( - product.notes, - style: TextStyle(fontSize: 16), + if (product.notes.isNotEmpty) + Padding( + padding: EdgeInsets.only(left: 20, top: 20, right: 20), + child: Text( + product.notes, + style: TextStyle(fontSize: 16), + ), ), - ), + if (product.imageUrl.isNotEmpty) + Padding( + padding: EdgeInsets.only(left: 20, top: 20, right: 20), + child: Image.network( + product.imageUrl, + width: double.infinity, + fit: BoxFit.contain, + ), + ), + SizedBox(height: 20), ], ); }