Skip to content

Commit eef890b

Browse files
committed
refactor(headlines-search): remove unused widget for feed action
- Remove the entire else-if block for FeedAction as it is no longer needed - This change simplifies the code and removes an unused widget
1 parent a616dbb commit eef890b

File tree

1 file changed

+0
-62
lines changed

1 file changed

+0
-62
lines changed

lib/headlines-search/view/headlines_search_page.dart

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -377,68 +377,6 @@ class _HeadlinesSearchViewState extends State<_HeadlinesSearchView> {
377377
),
378378
),
379379
);
380-
} else if (feedItem is FeedAction) {
381-
return Card(
382-
margin: const EdgeInsets.symmetric(
383-
vertical: AppSpacing.xs,
384-
),
385-
color: currentColorScheme.secondaryContainer,
386-
child: ListTile(
387-
leading: Icon(
388-
feedItem.feedActionType ==
389-
FeedActionType.linkAccount
390-
? Icons
391-
.link_outlined // Outlined
392-
: Icons.upgrade_outlined,
393-
color: currentColorScheme.onSecondaryContainer,
394-
),
395-
title: Text(
396-
feedItem.title,
397-
style: currentTextTheme.titleMedium?.copyWith(
398-
color:
399-
currentColorScheme.onSecondaryContainer,
400-
fontWeight: FontWeight.bold,
401-
),
402-
),
403-
subtitle: feedItem.description.isNotEmpty
404-
? Text(
405-
feedItem.description,
406-
style: currentTextTheme.bodySmall
407-
?.copyWith(
408-
color: currentColorScheme
409-
.onSecondaryContainer
410-
.withOpacity(0.85),
411-
),
412-
)
413-
: null,
414-
trailing: feedItem.callToActionText.isNotEmpty
415-
? ElevatedButton(
416-
style: ElevatedButton.styleFrom(
417-
backgroundColor:
418-
currentColorScheme.secondary,
419-
foregroundColor:
420-
currentColorScheme.onSecondary,
421-
padding: const EdgeInsets.symmetric(
422-
// Consistent padding
423-
horizontal: AppSpacing.md,
424-
vertical: AppSpacing.sm,
425-
),
426-
textStyle: currentTextTheme.labelLarge,
427-
),
428-
onPressed: () {
429-
context.push(feedItem.callToActionUrl);
430-
},
431-
child: Text(feedItem.callToActionText),
432-
)
433-
: null,
434-
isThreeLine: feedItem.description.length > 50,
435-
contentPadding: const EdgeInsets.symmetric(
436-
// Consistent padding
437-
horizontal: AppSpacing.paddingMedium,
438-
vertical: AppSpacing.paddingSmall,
439-
),
440-
),
441-
);
442380
}
443381
return const SizedBox.shrink();
444382
},

0 commit comments

Comments
 (0)