0

所以一直在我的颤振应用程序中使用google_mobile_ads,到目前为止,我已经设法在我的视图上很好地展示广告,但是当我将广告放在对话框上时出现问题,小部件后的视图被隐藏(我设法使用颤振看到它们devtools 这意味着绘制),这包括对话框操作。完整对话框如下:

  AlertDialog(
    title: Text('Exit App'),
    content: Container(
      child: Column(
        mainAxisSize: MainAxisSize.min,
        children: [
          Text(
            'Are you sure you want to exit app?',
            style: TextStyle(fontSize: 20),
          ),
          Container(
            margin: EdgeInsets.symmetric(
              vertical: 10,
            ),
            child: Center(
              child: Container(
                height: _dialogAd.size.height.toDouble(),
                width: _dialogAd.size.width.toDouble(),
                child: AdWidget(
                  ad: _dialogAd,
                ),
              ),
            ),
          ),
        ],
      ),
    ),
    actions: [
      TextButton(
        child: Text(
          'Yes',
          style: TextStyle(color: Theme.of(context).primaryColor, fontSize: 16),
        ),
        onPressed: () => Navigator.of(context).pop(true),
      ),
      TextButton(
        child: Text(
          'No',
          style: TextStyle(color: Theme.of(context).primaryColor, fontSize: 16),
        ),
        onPressed: () => Navigator.of(context).pop(false),
      ),
    ],
  );

我已经尝试了所有必要的方法,例如使父容器固定高度,更改视图但没有一个有效,是否有我可以使用的解决方法或修复,任何帮助将不胜感激,谢谢。

4

0 回答 0