File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
lib/headlines-feed/widgets Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ class HeadlineItemWidget extends StatelessWidget {
10
10
const HeadlineItemWidget ({
11
11
required this .headline,
12
12
required this .targetRouteName, // Add targetRouteName
13
+ this .trailing, // Add optional trailing widget
13
14
super .key,
14
15
});
15
16
@@ -19,6 +20,9 @@ class HeadlineItemWidget extends StatelessWidget {
19
20
/// The named route to navigate to when the item is tapped.
20
21
final String targetRouteName; // Add targetRouteName
21
22
23
+ /// An optional widget to display at the end of the row.
24
+ final Widget ? trailing;
25
+
22
26
// Helper for date formatting
23
27
static final _dateFormatter = DateFormat .yMd ().add_jm ();
24
28
@@ -159,6 +163,11 @@ class HeadlineItemWidget extends StatelessWidget {
159
163
],
160
164
),
161
165
),
166
+ // Add the trailing widget if provided
167
+ if (trailing != null ) ...[
168
+ const SizedBox (width: AppSpacing .md),
169
+ trailing! ,
170
+ ],
162
171
],
163
172
),
164
173
),
You can’t perform that action at this time.
0 commit comments