Skip to content

Conversation

nuntipat
Copy link

This pull request addresses two bugs and adds one feature:

  1. When the user taps on any images after the first image to open the gallery, the bottom image list will zoom in to the incorrect image as _currentPage is initialized to 0 instead of widget.initialIndex.
  2. The bottom image list does not update immediately when the user performs a left or right swipe gesture to change the image. To address this issue, the onPageChanged callback of the PageView is used instead of adding a listener to the PageController.
  3. The onPageChanged callback is added to allow the parent widget to be informed of the current visible image in the gallery. This functionality is needed for use with a custom AppBar action button (see Allow customize the app bar actions #18) to implement some actions based on the current image, e.g., download or delete.

@nuntipat nuntipat changed the title Add a callback when the user changes the current image Fix bugs in (bottom) image list rendering and allow tracking of the current image. May 12, 2024
@JPFrancoia
Copy link

Tested, it works. We should definitely merge this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants