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

Flutter 3.22 release mode issue #39

Closed
bluemon82 opened this issue Jun 11, 2024 · 8 comments
Closed

Flutter 3.22 release mode issue #39

bluemon82 opened this issue Jun 11, 2024 · 8 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@bluemon82
Copy link

When I run the example with Flutter 3.22 in release mode I can take/choose multiple images but only the last is shown.
When I delete the last image the previous image is shown. It's like the grid is collapsed to a stack.
With the latest flutter 3.19 it works as expected.

In this test I took 3 images, only one image is shown:
IMG_613D51D8158E-1

@shubham16g shubham16g self-assigned this Jun 21, 2024
@shubham16g
Copy link
Owner

Hi @simonmoser-bluesource,

I just investigated the issue and found that this issue is also with the flutter_reorderable_grid_view: ^4.0.0 package as well.
Since multi_image_picker_view is using flutter_reorderable_grid_view for reordering grid view, it happens here as well.

I raised an issue with at flutter_reorderable_grid_view repository:
karvulf/flutter-reorderable-grid-view#105

Unfortunately, that repository is not very active (the last release was 16 months ago). I think I should try any alternative for this.

@bluemon82
Copy link
Author

@shubham-gupta-16 thanks for looking into this issue. Hopefully 5.0.0 will be released soon.

@shubham16g
Copy link
Owner

flutter_reorderable_grid_view released v5.0.0. We need to update this version in multi_image_pickder_view.

@shubham16g shubham16g added bug Something isn't working help wanted Extra attention is needed labels Jul 2, 2024
@philitell
Copy link

Please release new version with flutter_reorderable_grid_viewv.5.0.1 - this will fix this issue

@philitell
Copy link

I can confirm that the issue is gone with flutter_reorderable_grid_viewv.5.0.1

Some refactoring is required - e.g. the onReorder-method of ReorderableBuilder (in multi_image_picker_view.dart) might look something like this:

onReorder: (ReorderedListFunction reorderedListFunction) {
    final List<ImageFile> reorderedList =
        reorderedListFunction(widget.controller.images.toList()) as List<ImageFile>;
    widget.controller.setImageList(reorderedList);
  },

MultiImagePickerController does not need a reOrderImages-method anymore. I would suggest a simple method to pass the reordered list to the controller

// in MultiImagePickerController:
  void setImageList(List<ImageFile> images) {
    _images.clear();
    _images = images;
    notifyListeners();
  }

@shubham16g
Copy link
Owner

I checked, but 5.0.1 doesn't solve the issue.

@shubham16g
Copy link
Owner

It happens with other reorderable plugins as well, i.e. reorderable_grid_view.

I think flutter has made some major changes in overlay handling in version 3.22

@shubham16g
Copy link
Owner

I checked it on Flutter version: 3.24.1 and it works fine. It seems like the issue was with the flutter version: 3.22.*.

Closing this issue as there is nothing to do with this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants