Skip to content

Commit a07a194

Browse files
committed
refactor(widgets): adjust layout and spacing of HeadlineTileImageStart
- Modify the column crossAxisAlignment to CrossAxisAlignment.start - Reorganize the widget tree to improve layout structure - Add spacing between headline actions row and headline content - Remove redundant SizedBox wrapper
1 parent 3faa2ff commit a07a194

File tree

1 file changed

+52
-49
lines changed

1 file changed

+52
-49
lines changed

lib/shared/widgets/feed_core/headline_tile_image_start.dart

Lines changed: 52 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,16 @@ class HeadlineTileImageStart extends StatelessWidget {
4545
horizontal: AppSpacing.paddingMedium,
4646
vertical: AppSpacing.xs,
4747
),
48-
child: InkWell(
49-
onTap:
50-
onHeadlineTap ??
51-
() => HeadlineTapHandler.handleHeadlineTap(context, headline),
52-
child: Padding(
53-
padding: const EdgeInsets.all(AppSpacing.md),
54-
child: Column(
55-
children: [
56-
Row(
48+
child: Column(
49+
crossAxisAlignment: CrossAxisAlignment.start,
50+
children: [
51+
InkWell(
52+
onTap:
53+
onHeadlineTap ??
54+
() => HeadlineTapHandler.handleHeadlineTap(context, headline),
55+
child: Padding(
56+
padding: const EdgeInsets.all(AppSpacing.md),
57+
child: Row(
5758
crossAxisAlignment: CrossAxisAlignment.start,
5859
children: [
5960
SizedBox(
@@ -87,53 +88,55 @@ class HeadlineTileImageStart extends StatelessWidget {
8788
),
8889
const SizedBox(width: AppSpacing.md),
8990
Expanded(
90-
child: SizedBox(
91-
height: 72,
92-
child: Column(
93-
crossAxisAlignment: CrossAxisAlignment.start,
94-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
95-
children: [
96-
HeadlineSourceRow(headline: headline),
97-
Text.rich(
98-
TextSpan(
99-
children: [
100-
if (headline.isBreaking)
101-
TextSpan(
102-
text: '${l10n.breakingNewsPrefix} - ',
103-
style: textTheme.titleMedium?.copyWith(
104-
fontWeight: FontWeight.w500,
105-
color: colorScheme.primary,
106-
),
91+
child: Column(
92+
crossAxisAlignment: CrossAxisAlignment.start,
93+
children: [
94+
HeadlineSourceRow(headline: headline),
95+
const SizedBox(height: AppSpacing.sm),
96+
Text.rich(
97+
TextSpan(
98+
children: [
99+
if (headline.isBreaking)
100+
TextSpan(
101+
text: '${l10n.breakingNewsPrefix} - ',
102+
style: textTheme.titleMedium?.copyWith(
103+
fontWeight: FontWeight.w500,
104+
color: colorScheme.primary,
107105
),
108-
TextSpan(text: headline.title),
109-
],
110-
),
111-
style: textTheme.titleMedium?.copyWith(
112-
fontWeight: FontWeight.w500,
113-
),
114-
maxLines: 2,
115-
overflow: TextOverflow.ellipsis,
106+
),
107+
TextSpan(text: headline.title),
108+
],
116109
),
117-
],
118-
),
110+
style: textTheme.titleMedium?.copyWith(
111+
fontWeight: FontWeight.w500,
112+
),
113+
maxLines: 2,
114+
overflow: TextOverflow.ellipsis,
115+
),
116+
],
119117
),
120118
),
121119
],
122120
),
123-
Padding(
124-
padding: const EdgeInsets.only(top: AppSpacing.md),
125-
child: BlocBuilder<HeadlinesFeedBloc, HeadlinesFeedState>(
126-
builder: (context, state) {
127-
return HeadlineActionsRow(
128-
headline: headline,
129-
engagements: state.engagementsMap[headline.id] ?? [],
130-
);
131-
},
132-
),
133-
),
134-
],
121+
),
122+
),
123+
Padding(
124+
padding: const EdgeInsets.fromLTRB(
125+
AppSpacing.md,
126+
0,
127+
AppSpacing.md,
128+
AppSpacing.xs,
129+
),
130+
child: BlocBuilder<HeadlinesFeedBloc, HeadlinesFeedState>(
131+
builder: (context, state) {
132+
return HeadlineActionsRow(
133+
headline: headline,
134+
engagements: state.engagementsMap[headline.id] ?? [],
135+
);
136+
},
137+
),
135138
),
136-
),
139+
],
137140
),
138141
);
139142
}

0 commit comments

Comments
 (0)