This commit is contained in:
Dmitry 2024-07-25 02:35:38 +03:00
parent f88b7ff3df
commit 30fdd2a174
3 changed files with 4 additions and 2 deletions

View file

@ -6,7 +6,7 @@ import 'package:yandex_mobileads/mobile_ads.dart';
class YandexAds { class YandexAds {
static BannerAd createBanner( static BannerAd createBanner(
BoxConstraints constraints, { BoxConstraints constraints, {
String id = 'demo-banner-yandex', required String id,
String? key, String? key,
VoidCallback? onLoaded, VoidCallback? onLoaded,
}) { }) {

View file

@ -257,7 +257,9 @@ class _AdTile extends StatelessWidget {
if (kIsWeb) return SizedBox.shrink(); if (kIsWeb) return SizedBox.shrink();
return LayoutBuilder(builder: (context, constraints) { return LayoutBuilder(builder: (context, constraints) {
final banner = YandexAds.createBanner( final banner = YandexAds.createBanner(
BoxConstraints.tight(Size(constraints.maxWidth - 16, 80 - 8))); BoxConstraints.tight(Size(constraints.maxWidth - 16, 80 - 8)),
id: 'R-M-3761037-2'
);
return FadeInWidget( return FadeInWidget(
future: banner.loadAd(), future: banner.loadAd(),
animationDuration: Duration(milliseconds: 1000), animationDuration: Duration(milliseconds: 1000),