2

I want to get picture by image_picker, but my project apper error. Please tell me the solution.

error↓

image_picker: compressing is not supported for type (null). Returning the image with original quality
flutter: /private/var/mobile/Containers/Data/Application/~~~~/tmp/image_picker_~~~~.jpg

myProject code

import 'package:flutter/material.dart';
import 'dart:io';
import 'package:image_picker/image_picker.dart';

File? _image;
final picker = ImagePicker();
XFile? pickedFile = await picker.pickImage(source: ImageSource.gallery);

Future _getImage() async {
      setState(() {
        if (pickedFile != null) {
          print("${pickedFile.path}");
          _image = File(pickedFile.path);
        }else{
          print("NO IMAGE");
        }
        _image = File(pickedFile!.path);
      });
    }
2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.