Home>

I want to use Multi_Image_Picker in Flutter to select two photos and then mark them as "Selected" so that when I open the Photo Library again to select another photo, I can see the previously selected photo. is. What kind of code do you need?
Thank you for your guidance.

My code is below.

resultList= await MultiImagePicker.pickImages (
    maxImages: 2,
    selectedAssets: images,
    enableCamera: true,
    cupertinoOptions: CupertinoOptions (
      selectionFillColor: "# ff11ab",
      selectionTextColor: "# ffffff",
  );
  • Answer # 1

    Can you tell me the version of Multi_Image_Picker, now from the official page, Multi_Image_Picker is no longer supported.
    The following packages were recommended on its official page:

    I don't think it will be difficult to realize the function you are asking.
    I won't give you specific code, but just the idea

      Store information on your device using the
    1. shared_preferences package. (For example, photo filenames and IDs)
    2. Save information on device when closing page
    3. When you open the page again, read the information from the device and select the photo

    and above

    I am using 4.7.15 of multi_image_picker. It was the same even if I used 5.0.2 of multi_image_picker2 below. pub.dev/packages/multi_image_picker2 Wechat_assets_picker pointed out and get device information. Thank you very much.

    Kaz2021-12-16 18:31:59
  • Answer # 2

    Can you tell me the version of Multi_Image_Picker, now from the official page, Multi_Image_Picker is no longer supported.
    The following packages were recommended on its official page:

    I don't think it will be difficult to realize the function you are asking.
    I won't give you specific code, but just the idea

      Store information on your device using the
    1. shared_preferences package. (For example, photo filenames and IDs)
    2. Save information on device when closing page
    3. When you open the page again, read the information from the device and select the photo

    and above

    I am using 4.7.15 of multi_image_picker. It was the same even if I used 5.0.2 of multi_image_picker2 below. pub.dev/packages/multi_image_picker2 Wechat_assets_picker pointed out and get device information. Thank you very much.

    Kaz2021-12-16 18:32:00