diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e58d033..cc7e91af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 031ef09a..f822f4c1 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -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: diff --git a/lib/src/delegates/asset_picker_viewer_builder_delegate.dart b/lib/src/delegates/asset_picker_viewer_builder_delegate.dart index a146984c..615041ef 100644 --- a/lib/src/delegates/asset_picker_viewer_builder_delegate.dart +++ b/lib/src/delegates/asset_picker_viewer_builder_delegate.dart @@ -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; } diff --git a/pubspec.yaml b/pubspec.yaml index 6d1ad5b1..ac73723c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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,