@@ -7,14 +7,27 @@ import 'package:ui_kit/ui_kit.dart';
77/// {@endtemplate}
88class LocalNativeAdWidget extends StatelessWidget {
99 /// {@macro local_native_ad_widget}
10- const LocalNativeAdWidget ({required this .localNativeAd, super .key});
10+ const LocalNativeAdWidget ({
11+ required this .localNativeAd,
12+ this .headlineImageStyle,
13+ super .key,
14+ });
1115
1216 /// The [LocalNativeAd] to display.
1317 final LocalNativeAd localNativeAd;
1418
19+ /// The user's preference for feed layout, used to determine the ad's visual size.
20+ final HeadlineImageStyle ? headlineImageStyle;
21+
1522 @override
1623 Widget build (BuildContext context) {
1724 final theme = Theme .of (context);
25+
26+ // Determine the height based on the headlineImageStyle.
27+ // If largeThumbnail, use a square aspect ratio, otherwise a standard native ad height.
28+ final double imageHeight =
29+ headlineImageStyle == HeadlineImageStyle .largeThumbnail ? 250 : 180 ;
30+
1831 return Card (
1932 margin: const EdgeInsets .symmetric (
2033 horizontal: AppSpacing .paddingMedium,
@@ -31,7 +44,7 @@ class LocalNativeAdWidget extends StatelessWidget {
3144 child: Image .network (
3245 localNativeAd.imageUrl,
3346 fit: BoxFit .cover,
34- height: 180 ,
47+ height: imageHeight ,
3548 width: double .infinity,
3649 errorBuilder: (context, error, stackTrace) =>
3750 const SizedBox .shrink (),
0 commit comments