'Can't get image file through image picker in flutter

i can't get images file through image picker in flutter.

void _getImage() async {
    print("getImage");
    final ImagePicker picker = ImagePicker();
    XFile? image = await picker.pickImage(source: ImageSource.gallery);
    print(image);
}

and error's occur, look at this

enter image description here

my enviroment is M1 pro, ios15.2



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source