Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Support Multiple Special Items #635

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove redundant codes.
yujunetee committed Dec 11, 2024
commit d15ee2814cd403abe0420a8507be4f6ec7dfa8f6
18 changes: 8 additions & 10 deletions lib/src/delegates/asset_picker_builder_delegate.dart
Original file line number Diff line number Diff line change
@@ -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();