Appodeal-Flutter-Plugin icon indicating copy to clipboard operation
Appodeal-Flutter-Plugin copied to clipboard

Banner size is not updated after screen size changes

Open raspberry-jenshen opened this issue 2 years ago • 3 comments

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

raspberry-jenshen avatar Jul 18 '23 13:07 raspberry-jenshen

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.

da2gl avatar Jul 19 '23 14:07 da2gl

Thanks for your answer!

Just to clarify.

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

  • I don't need to use the AppodealBanner widget
  • Banner only limited with screen size and I can't change this behavior (like adding paddings)

Thanks in advance!

raspberry-jenshen avatar Jul 19 '23 15:07 raspberry-jenshen

@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!

da2gl avatar Jul 20 '23 12:07 da2gl