Skip to content

Commit

Permalink
🐛 Fix the index with bottom items in the preview (fluttercandies#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexV525 authored Mar 15, 2024
1 parent 263db78 commit 0a7ac0f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ that can be found in the LICENSE file. -->
> [!IMPORTANT]
> See the [Migration Guide](guides/migration_guide.md) for the details of breaking changes between versions.
## 9.0.2

### Fixes

- Fix the index with bottom items in the preview.

## 9.0.1

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: wechat_assets_picker_demo
description: The demo project for the wechat_assets_picker package.
version: 9.0.0+49
version: 9.0.2+51
publish_to: none

environment:
Expand Down
5 changes: 4 additions & 1 deletion lib/src/delegates/asset_picker_viewer_builder_delegate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -608,12 +608,15 @@ class DefaultAssetPickerViewerBuilderDelegate
const double padding = 8.0;

void onTap(AssetEntity asset) {
final int page;
int page;
if (previewAssets != selectedAssets) {
page = previewAssets.indexOf(asset);
} else {
page = index;
}
if (shouldReversePreview) {
page = previewAssets.length - page - 1;
}
if (pageController.page == page.toDouble()) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: wechat_assets_picker
version: 9.0.1
version: 9.0.2
description: |
An image picker (also with videos and audio)
for Flutter projects based on WeChat's UI,
Expand Down

0 comments on commit 0a7ac0f

Please sign in to comment.