@@ -252,6 +252,7 @@ abstract class AssetPickerBuilderDelegate<A, P> {
252
252
/// The main grid view builder for assets.
253
253
/// 主要的资源查看网格部件
254
254
Widget assetsGridBuilder (BuildContext context) {
255
+ final int hashCode = provider.currentPathEntity? .hashCode ?? 0 ;
255
256
return ColoredBox (
256
257
color: theme.canvasColor,
257
258
child: Selector <AssetPickerProvider <A , P >, List <A >>(
@@ -269,16 +270,16 @@ abstract class AssetPickerBuilderDelegate<A, P> {
269
270
SliverGrid (
270
271
delegate: SliverChildBuilderDelegate (
271
272
(_, int index) => Builder (
272
- key: ValueKey <int >(index),
273
+ key: ValueKey <int >(index + hashCode ),
273
274
builder: (BuildContext c) => assetGridItemBuilder (
274
275
c,
275
276
index,
276
277
currentAssets,
277
278
),
278
279
),
279
280
childCount: assetsGridItemCount (_, currentAssets),
280
- findChildIndexCallback: (Key ? key) =>
281
- (key as ValueKey <int >? ) ? .value,
281
+ findChildIndexCallback: (Key key) =>
282
+ (key as ValueKey <int >) .value - hashCode ,
282
283
),
283
284
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount (
284
285
crossAxisCount: gridCount,
0 commit comments