【发布时间】:2021-09-04 15:14:35
【问题描述】:
我需要在我的银色列表的第 6 个帖子之后展示一个广告,现在我正在执行以下方法并且它正在工作,但它正在替换广告中的帖子而不是实际添加它。
SliverList(
delegate: SliverChildBuilderDelegate((context, i) {
if ( i != 0 && i % 6 == 0 ) { // this replacing each 6th on the list not adding new
// return ad widget
}
// return list item
},
childCount: dynamicListLength
)
【问题讨论】:
-
将 i % 6 = 0 更改为 i % 6 == 0
-
很抱歉,这是一个错字,但我的代码中当然已经是
==
标签: android ios flutter dart flutter-layout