From c2b986170f4959c9b34f536002a86ba0a968d5a6 Mon Sep 17 00:00:00 2001 From: yujune Date: Wed, 16 Oct 2024 16:28:00 +0800 Subject: [PATCH] Remove redundant codes. --- .../asset_picker_builder_delegate.dart | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/src/delegates/asset_picker_builder_delegate.dart b/lib/src/delegates/asset_picker_builder_delegate.dart index a314b1c3..985d3218 100644 --- a/lib/src/delegates/asset_picker_builder_delegate.dart +++ b/lib/src/delegates/asset_picker_builder_delegate.dart @@ -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();