Skip to content

Commit e469f8a

Browse files
committed
refactor(widget): remove dismiss option from call-to-action decorator
- Remove PopupMenuButton for dismissal option - Simplify widget structure by removing related callback and logic - Update documentation to reflect changes
1 parent 3b772f5 commit e469f8a

File tree

1 file changed

+2
-31
lines changed

1 file changed

+2
-31
lines changed

lib/shared/widgets/feed_decorators/call_to_action_decorator_widget.dart

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ import 'package:ui_kit/ui_kit.dart';
77
/// A widget to display a call-to-action feed decorator.
88
///
99
/// This widget presents a card with a title, description, and a call-to-action
10-
/// button. It also includes a dismiss option via a [PopupMenuButton].
10+
/// button.
1111
/// {@endtemplate}
1212
class CallToActionDecoratorWidget extends StatelessWidget {
1313
/// {@macro call_to_action_decorator_widget}
1414
const CallToActionDecoratorWidget({
1515
required this.item,
1616
required this.onCallToAction,
17-
required this.onDismiss,
1817
super.key,
1918
});
2019

@@ -24,9 +23,6 @@ class CallToActionDecoratorWidget extends StatelessWidget {
2423
/// Callback function when the call-to-action button is pressed.
2524
final ValueSetter<String> onCallToAction;
2625

27-
/// Callback function when the dismiss option is selected.
28-
final ValueSetter<FeedDecoratorType> onDismiss;
29-
3026
@override
3127
Widget build(BuildContext context) {
3228
// final l10n = context.l10n;
@@ -43,32 +39,7 @@ class CallToActionDecoratorWidget extends StatelessWidget {
4339
child: Column(
4440
crossAxisAlignment: CrossAxisAlignment.start,
4541
children: [
46-
Row(
47-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
48-
children: [
49-
Expanded(
50-
child: Text(
51-
item.title,
52-
style: theme.textTheme.titleLarge,
53-
maxLines: 2,
54-
overflow: TextOverflow.ellipsis,
55-
),
56-
),
57-
PopupMenuButton<String>(
58-
onSelected: (value) {
59-
if (value == 'dismiss') {
60-
onDismiss(item.decoratorType);
61-
}
62-
},
63-
itemBuilder: (context) => [
64-
PopupMenuItem(
65-
value: 'dismiss',
66-
child: Text(l10n.neverShowAgain),
67-
),
68-
],
69-
),
70-
],
71-
),
42+
Text(item.title, style: theme.textTheme.titleLarge),
7243
const SizedBox(height: AppSpacing.sm),
7344
Text(
7445
item.description,

0 commit comments

Comments
 (0)