Skip to content

Commit 1618425

Browse files
committed
refactor(headline-details): adjust spacing around in-article ads and buttons
- Remove ad slot below main article image - Adjust padding around in-article ads, buttons, and related widgets - Change padding values from xl (24.0) to lg (16.0) for more consistent spacing - Update comments for better clarity on padding adjustments
1 parent df75125 commit 1618425

File tree

1 file changed

+7
-37
lines changed

1 file changed

+7
-37
lines changed

lib/headline-details/view/headline_details_page.dart

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -314,36 +314,6 @@ class _HeadlineDetailsPageState extends State<HeadlineDetailsPage> {
314314
),
315315
];
316316

317-
// Add ad below main article image if configured
318-
if (adConfig != null &&
319-
adConfig.enabled &&
320-
adConfig.articleAdConfiguration.enabled) {
321-
final belowMainImageSlot = adConfig
322-
.articleAdConfiguration
323-
.inArticleAdSlotConfigurations
324-
.firstWhereOrNull(
325-
(slot) =>
326-
slot.slotType == InArticleAdSlotType.belowMainArticleImage &&
327-
slot.enabled,
328-
);
329-
330-
if (belowMainImageSlot != null) {
331-
slivers.add(
332-
SliverToBoxAdapter(
333-
child: Padding(
334-
padding: horizontalPadding.copyWith(top: AppSpacing.lg),
335-
child: InArticleAdLoaderWidget(
336-
slotConfiguration: belowMainImageSlot,
337-
adService: adService,
338-
adThemeStyle: adThemeStyle,
339-
adConfig: adConfig,
340-
),
341-
),
342-
),
343-
);
344-
}
345-
}
346-
347317
slivers.addAll([
348318
SliverPadding(
349319
padding: horizontalPadding.copyWith(top: AppSpacing.lg),
@@ -388,7 +358,7 @@ class _HeadlineDetailsPageState extends State<HeadlineDetailsPage> {
388358
slivers.add(
389359
SliverToBoxAdapter(
390360
child: Padding(
391-
padding: horizontalPadding.copyWith(top: AppSpacing.xl),
361+
padding: horizontalPadding.copyWith(top: AppSpacing.lg),
392362
child: InArticleAdLoaderWidget(
393363
slotConfiguration: aboveContinueReadingSlot,
394364
adService: adService,
@@ -405,8 +375,8 @@ class _HeadlineDetailsPageState extends State<HeadlineDetailsPage> {
405375
if (headline.url.isNotEmpty)
406376
SliverPadding(
407377
padding: horizontalPadding.copyWith(
408-
top: AppSpacing.xl,
409-
bottom: AppSpacing.xl,
378+
top: AppSpacing.lg, // Adjusted for symmetry
379+
bottom: AppSpacing.lg, // Adjusted for symmetry
410380
),
411381
sliver: SliverToBoxAdapter(
412382
child: ElevatedButton.icon(
@@ -429,7 +399,7 @@ class _HeadlineDetailsPageState extends State<HeadlineDetailsPage> {
429399
),
430400
if (headline.url.isEmpty) // Ensure bottom padding
431401
const SliverPadding(
432-
padding: EdgeInsets.only(bottom: AppSpacing.xl),
402+
padding: EdgeInsets.only(bottom: AppSpacing.lg), // Adjusted for symmetry
433403
sliver: SliverToBoxAdapter(child: SizedBox.shrink()),
434404
),
435405
]);
@@ -452,7 +422,7 @@ class _HeadlineDetailsPageState extends State<HeadlineDetailsPage> {
452422
slivers.add(
453423
SliverToBoxAdapter(
454424
child: Padding(
455-
padding: horizontalPadding.copyWith(top: AppSpacing.xl),
425+
padding: horizontalPadding.copyWith(top: AppSpacing.lg), // Adjusted for symmetry
456426
child: InArticleAdLoaderWidget(
457427
slotConfiguration: belowContinueReadingSlot,
458428
adService: adService,
@@ -470,8 +440,8 @@ class _HeadlineDetailsPageState extends State<HeadlineDetailsPage> {
470440
padding: horizontalPadding,
471441
sliver: SliverToBoxAdapter(
472442
child: Padding(
473-
padding: EdgeInsets.only(
474-
top: (headline.url.isNotEmpty) ? AppSpacing.sm : AppSpacing.xl,
443+
padding: const EdgeInsets.only(
444+
top: AppSpacing.xl, // Adjusted for consistent separation
475445
bottom: AppSpacing.md,
476446
),
477447
child: Text(

0 commit comments

Comments
 (0)