multi_image_picker_view icon indicating copy to clipboard operation
multi_image_picker_view copied to clipboard

Flutter 3.22 release mode issue

Open bluemon82 opened this issue 1 year ago • 7 comments

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

bluemon82 avatar Jun 11 '24 13:06 bluemon82

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: https://github.com/karvulf/flutter-reorderable-grid-view/issues/105

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

shubham16g avatar Jun 22 '24 17:06 shubham16g

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

bluemon82 avatar Jun 24 '24 05:06 bluemon82

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

shubham16g avatar Jul 02 '24 06:07 shubham16g

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

philitell avatar Jul 30 '24 11:07 philitell

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();
  }

philitell avatar Jul 30 '24 12:07 philitell

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

shubham16g avatar Jul 31 '24 10:07 shubham16g

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 avatar Jul 31 '24 10:07 shubham16g

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.

shubham16g avatar Aug 31 '24 10:08 shubham16g