Skip to content

Commit

Permalink
Remove redundant codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
yujunetee committed Oct 16, 2024
1 parent 6de284c commit c2b9861
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions lib/src/delegates/asset_picker_builder_delegate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1429,21 +1429,19 @@ class DefaultAssetPickerBuilderDelegate
}
}

if (specialItemModels.isNotEmpty) {
if (prepandSpecialItemModels.isNotEmpty) {
if (index < prepandSpecialItemModels.length) {
return specialItemModels[index].item;
}
if (prependItems.isNotEmpty) {
if (index < prependItems.length) {
return specialItemModels[index].item;
}
}

if (appendSpecialItemModels.isNotEmpty) {
if (index >= length + prepandSpecialItemModels.length) {
return specialItemModels[index - length].item;
}
if (appendItems.isNotEmpty) {
if (index >= length + prependItems.length) {
return specialItemModels[index - length].item;
}
}

final currentIndex = index - prepandSpecialItemModels.length;
final currentIndex = index - prependItems.length;

if (currentPathEntity == null) {
return const SizedBox.shrink();
Expand Down

0 comments on commit c2b9861

Please sign in to comment.