【问题标题】:I want to show interstitial between multiple pages in flutter我想在颤动的多个页面之间显示插页式
【发布时间】:2019-09-29 18:15:50
【问题描述】:

我有多个 pages.screen_one 和 screen_two.First screen_one 到 screen_two,然后我想在从 screen_two 到 screen_one 返回时显示插页式广告。怎么做。

【问题讨论】:

  • 为此使用onDispose,在其中启动一个插页式广告。
  • 你能分享示例代码吗?@meditat
  • 类似@override void dispose() { super.dispose(); //your show interstitial method showInterstitial(); }

标签: flutter admob interstitial


【解决方案1】:

您可以在屏幕二的小部件树顶部使用 WillPopScope 小部件,设置用户使用后退按钮时的功能,但在此上显示广告违反 admob 政策。

           return WillPopScope(
                  onWillPop: () async {
                    showInterstitial();
                    return null;
                    child: ...
                  },
                );

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-03
    • 1970-01-01
    • 2015-10-08
    • 1970-01-01
    • 2021-10-23
    • 1970-01-01
    相关资源
    最近更新 更多