简体   繁体   中英

Flutter multi_image_picker camera option not showing in iOS. When i already enable camera and write the the permission in info.plist

It showing the only recent pictures. I want a camera option too. Here is my code.

  Future<void> loadAssets(StateSetter setModalState) async {
    print("On pressed");
    List<Asset> resultList = List<Asset>();
    String error = 'No Error Dectected';

    try {
      resultList = await MultiImagePicker.pickImages(
        maxImages: 2,
        enableCamera: true,
        selectedAssets: image,
        materialOptions: MaterialOptions(
          actionBarColor: "#abcdef",
          actionBarTitle: "Example App",
          allViewTitle: "All Photos",
          useDetailsView: false,
          selectCircleStrokeColor: "#000000",
        ),
      );
    } on Exception catch (e) {
      error = e.toString();
    }

    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setModalState(() {
      image = resultList;
      print("Set state");
      if(image.length>0){
        showUploadButton = false;
      }else{
        showUploadButton = true;
      }

     // _error = error;
      //print(_error);
    });
  }

I don't know why this happening. I already delete the app and reinstall.And also clean the android studio. But it still shows only recent pictures

write in info.plist

    <key>NSPhotoLibraryUsageDescription</key>
    <string>This app requires access to the photo library.</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>This app does not require access to the microphone.</string>
    <key>NSCameraUsageDescription</key>
    <string>This app requires access to the camera.</string>

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM