Skip to content

Commit b34a2dc

Browse files
committed
feat(ads): display ads in entity details page
- Add support for displaying ads in the entity details page - Implement AdLoaderWidget to load and show ads - Update imports to include necessary ad-related classes and services
1 parent 0700ac0 commit b34a2dc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/entity_details/view/entity_details_page.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import 'package:flutter/material.dart';
66
import 'package:flutter_bloc/flutter_bloc.dart';
77
import 'package:flutter_news_app_mobile_client_full_source_code/account/bloc/account_bloc.dart';
88
import 'package:flutter_news_app_mobile_client_full_source_code/ads/ad_service.dart';
9+
import 'package:flutter_news_app_mobile_client_full_source_code/ads/models/ad_placeholder.dart';
910
import 'package:flutter_news_app_mobile_client_full_source_code/ads/models/ad_theme_style.dart';
11+
import 'package:flutter_news_app_mobile_client_full_source_code/ads/widgets/ad_loader_widget.dart';
1012
import 'package:flutter_news_app_mobile_client_full_source_code/app/bloc/app_bloc.dart';
1113
import 'package:flutter_news_app_mobile_client_full_source_code/entity_details/bloc/entity_details_bloc.dart';
1214
import 'package:flutter_news_app_mobile_client_full_source_code/l10n/app_localizations.dart';
@@ -381,6 +383,13 @@ class _EntityDetailsViewState extends State<EntityDetailsView> {
381383
);
382384
}
383385
return tile;
386+
} else if (item is AdPlaceholder) {
387+
return AdLoaderWidget(
388+
adPlaceholder: item,
389+
adService: context.read<AdService>(),
390+
adThemeStyle:
391+
AdThemeStyle.fromTheme(Theme.of(context)),
392+
);
384393
}
385394
return const SizedBox.shrink();
386395
},

0 commit comments

Comments
 (0)