appodeal / Appodeal-Flutter-Plugin

Official Flutter Plugin that adds Appodeal SDK support to your Flutter application.
https://pub.dev/packages/stack_appodeal_flutter
Apache License 2.0
18 stars 3 forks source link

Banner size is not updated after screen size changes #43

Open raspberry-jenshen opened 11 months ago

raspberry-jenshen commented 11 months ago

Hello,

I've found an issue that the banner isn't updated after the screen size was changed.

Preconditions: I try to use maximum space for the banner widget. So, my banner size depends on the screen size.

Widget example:

AppodealBanner(
      adSize: AppodealBannerSize(
        width: banner.size.width.round(),
        height: banner.size.height.round(),
        name: 'BANNER',
      ),
    )

When you rotate the device we have to update the banner size but nothing changes.

How to resolve the issue:

@override
  void didUpdateWidget(AppodealBanner oldWidget) {
    super.initState(oldWidget);
    if (widget.adSize != oldWidget.adSize) {
      setState(() {
        adSize = Future.value(Size(
          widget.adSize.width.toDouble(),
          widget.adSize.height.toDouble(),
        ));
      });
    }

  }

photo_2023-07-18_14-08-35

Not updated size after rotation. photo_2023-07-18_14-08-41

da2gl commented 11 months ago

Hello @JenshenSoft. We have started investigating your issue. Unfortunately, our banner views do not currently support smart behavior, only fixed size. This is described here.

Could you please provide more details about your use case for banners? It seems that you can simply use the method Appodeal.show(AppodealAdType.BannerTop); More information here.

Thank you.

raspberry-jenshen commented 11 months ago

Thanks for your answer!

Just to clarify.

If I use positioned banners (AppodealAdType.BannerTop, etc..):

Thanks in advance!

da2gl commented 11 months ago

@raspberry-jenshen Hi.

I don't need to use the AppodealBanner widget

Yes

Banner only limited with screen size and I can't change this behavior (like adding paddings)

Yes, unfortunately, you can't change any banner presentation in any way. About the size of the banner width - it may depend on the ad network. For example, AdMob supports full width, but Bidmachine ad network doesn't.

Thanks!