[英]How to place banner ad on top of App Bar in Flutter?
Try prefferedSizeAppbar widget and increase the app bar height and use you banner.尝试 prefferedSizeAppbar 小部件并增加应用栏高度并使用您的横幅。
You can use PreferredSize or flexibleSpace ,您可以使用PreferredSize或flexibleSpace ,
appBar: PreferredSize(
preferredSize: Size.fromHeight(120), // change height of ads as you like
child: Container(
child: // here is ads
)
)
or或者
appBar: AppBar(
toolbarHeight: 120, // Set this appbar height
flexibleSpace: Container(
child: Text("this is add"), // make container of your ads
),
title: Text('Material App Bar'),
),
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.