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
20 stars 3 forks source link

AppodealBannerView not display in PageView #4

Closed namdp closed 1 year ago

namdp commented 2 years ago

PageView have 3 childs: widget1, widget2, widget3. Each widget have it's custom AppodealBannerView. First we open widget1 -> AppodealBannerView display correct, but if we open widget2 then return to widget1 -> AppodealBannerView display blank

da2gl commented 2 years ago

@namdp Hello! Thanks for your issue, we started to investigate this behavior.

da2gl commented 1 year ago

@namdp Hello! At the moment, we still don't have a solution for rendering one banner object on different PageView. It would be more correct to make an implementation where the Appodeal Banner is separated from the PageView. Example:

class _PageViewDemoState extends State<PageViewDemo> {
  final _controller = PageController(
    initialPage: 0,
  );

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Column(children: <Widget>[
      Center(
        child: AppodealBanner(adSize: AppodealBannerSize.BANNER),
      ),
      Expanded(
          flex: 1,
          child: PageView(
            controller: _controller,
            children: const [
              MyPageWidget(1),
              MyPageWidget(2),
              MyPageWidget(3),
            ],
          ))
    ]);
  }
}