fix observer for history section

Robert Malikowski committed Jun 26, 2026 at 10:37 UTC 117f8e922a8506f14e6a236147814a4c24edc2a9
1 file changed +10 -7
lib/new-ui/widgets/coins_page/assets_history/history_section.dart
+10 -7
@@ -34,12 +34,14 @@ class HistorySection extends StatelessWidget {
34
35 @override
36 Widget build(BuildContext context) {
37 - final items = short ? dashboardViewModel.itemsShort : dashboardViewModel.items;
37
38 return SliverPadding(
39 padding: EdgeInsets.only(left: 16.0, right: 16, top: short && roundedTopSection ? 18 : 0),
40 sliver: Observer(
42 - builder: (_) => (items.isEmpty)
41 + builder: (_) {
42 + final items = short ? dashboardViewModel.itemsShort : dashboardViewModel.items;
43 +
44 + return (items.isEmpty)
45 ? SliverPadding(
46 padding: EdgeInsets.only(top: 24),
47 sliver: SliverToBoxAdapter(
@@ -203,7 +205,8 @@ class HistorySection extends StatelessWidget {
205 return Text(item.runtimeType.toString());
206 }),
207 ),
206 - ),
208 + );
209 + },
210 ));
211 }
212
@@ -237,15 +240,15 @@ class HistorySection extends StatelessWidget {
240
241 if (daysAgo < 7) {
242 final weekday = DateFormat.EEEE().format(date);
240 - return '$weekday, $timeStr';
243 + return "$weekday, $timeStr";
244 }
245
246 if (date.year == now.year) {
247 final dayMonth = DateFormat("d MMMM").format(date);
245 - return '$dayMonth, $timeStr';
248 + return "$dayMonth, $timeStr";
249 }
250
248 - final full = DateFormat("d MMMM yyyy").format(date);
249 - return '$full, $timeStr';
251 + final full = DateFormat("d MMM yyyy").format(date);
252 + return "$full, $timeStr";
253 }
254 }