findChildIndexBuilder method
int
findChildIndexBuilder({
- required String id,
- required List<
AssetEntity> assets, - int placeholderCount = 0,
override
Indicates how would the grid found a reusable RenderObject through id
.
为 Grid 布局指示如何找到可复用的 RenderObject。
See also:
Implementation
@override
int findChildIndexBuilder({
required String id,
required List<AssetEntity> assets,
int placeholderCount = 0,
}) {
int index = assets.indexWhere((AssetEntity e) => e.id == id);
if (specialItemPosition == SpecialItemPosition.prepend) {
index += 1;
}
index += placeholderCount;
return index;
}