Skip to content

Commit 105abcf

Browse files
yujuneAlexV525
andcommitted
Update lib/src/delegates/asset_picker_builder_delegate.dart
Co-authored-by: Alex Li <[email protected]>
1 parent 1732cfe commit 105abcf

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

lib/src/delegates/asset_picker_builder_delegate.dart

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,12 +1418,16 @@ class DefaultAssetPickerBuilderDelegate
14181418
final PathWrapper<AssetPathEntity>? currentWrapper = p.currentPath;
14191419
final AssetPathEntity? currentPathEntity = currentWrapper?.path;
14201420

1421-
final prepandSpecialItemModels = specialItemModels.where(
1422-
(model) => model.position == SpecialItemPosition.prepend,
1423-
);
1424-
final appendSpecialItemModels = specialItemModels.where(
1425-
(model) => model.position == SpecialItemPosition.append,
1426-
);
1421+
final prependItems = <SpecialItemModel>[];
1422+
final appendItems = <SpecialItemModel>[];
1423+
for (final model in specialItemModels) {
1424+
switch (model.position) {
1425+
case SpecialItemPosition.prepend:
1426+
prependItems.add(model);
1427+
case SpecialItemPosition.append:
1428+
appendItems.add(model);
1429+
}
1430+
}
14271431

14281432
if (specialItemModels.isNotEmpty) {
14291433
if (prepandSpecialItemModels.isNotEmpty) {

0 commit comments

Comments
 (0)