如何将横幅广告的位置设置到右上方

时间:2019-09-28 04:13:31

标签: flutter dart

我正在开发一个应用程序,其中将横幅广告放在屏幕上,我想将该横幅广告移动到左侧或右侧,我能够垂直移动但不能水平移动。

1 个答案:

答案 0 :(得分:-1)

尝试以下代码段:

Widget getBannerContainer(){
    var offerBannerHeight = 93.0;
    var offerBannerWidth = screenWidth;
    var list = PageView.builder(
    controller: controller,
    itemCount: 10,
    scrollDirection: Axis.horizontal,
    itemBuilder: (BuildContext context, int position) {

      final bannerDetail = this.widget.bannerList[position];
      final bannerImage = FadeInImage.assetNetwork(placeholder: placeholderImage, image: Bannerimg, fit: BoxFit.cover, width: offerBannerWidth,
    height: offerBannerHeight,);

      final bannerImageInkWell = InkWell(child: bannerImage, onTap: () {},);
      return bannerImageInkWell;
    });
    this.startTimer();
    return Container(child: list, height: offerBannerHeight,);
}

希望这会有所帮助!