Skip to content

Commit

Permalink
Show product image if link is set
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed May 19, 2024
1 parent faf7cfe commit 0a33858
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions lib/ui/product/view/product_view_overview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@ class _ProductOverviewState extends State<ProductOverview> {
formatNumberType: FormatNumberType.int);
}

if (product.imageUrl.isNotEmpty) {
fields[localization.imageUrl] = product.imageUrl;
}

return ScrollableListView(
children: <Widget>[
EntityHeader(
Expand All @@ -127,13 +123,24 @@ class _ProductOverviewState extends State<ProductOverview> {
),
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),
],
);
}
Expand Down

0 comments on commit 0a33858

Please sign in to comment.