From f5e3b4ac80fd58a4646f171a1f07b33bca4743b5 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 24 Dec 2024 01:05:59 +1100 Subject: [PATCH] Fix order of operations (#591) --- lib/widget/stock/stock_detail.dart | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/widget/stock/stock_detail.dart b/lib/widget/stock/stock_detail.dart index 1390637f..50331f2d 100644 --- a/lib/widget/stock/stock_detail.dart +++ b/lib/widget/stock/stock_detail.dart @@ -738,19 +738,19 @@ class _StockItemDisplayState extends RefreshableState { Widget? _expiryIcon; - if (widget.item.stale) { - _expiryIcon = Text(L10().expiryStale, style: TextStyle(color: COLOR_WARNING)); - } else if (widget.item.expired) { + if (widget.item.expired) { _expiryIcon = Text(L10().expiryExpired, style: TextStyle(color: COLOR_DANGER)); + } else if (widget.item.stale) { + _expiryIcon = Text(L10().expiryStale, style: TextStyle(color: COLOR_WARNING)); } tiles.add( - ListTile( - title: Text(L10().expiryDate), - subtitle: Text(widget.item.expiryDateString), - leading: Icon(TablerIcons.calendar_x), - trailing: _expiryIcon, - ) + ListTile( + title: Text(L10().expiryDate), + subtitle: Text(widget.item.expiryDateString), + leading: Icon(TablerIcons.calendar_x), + trailing: _expiryIcon, + ) ); }