this is my code
chooseImage() async {
XFile? pickedFile = await ImagePicker().pickImage(
source: ImageSource.gallery,
);
imagePath = await pickedFile!.readAsBytes();
}
this is my code
chooseImage() async {
XFile? pickedFile = await ImagePicker().pickImage(
source: ImageSource.gallery,
);
imagePath = await pickedFile!.readAsBytes();
}
2
Answers
You can use
imageQuality
properties. The higher the quality, the larger the file size of the image.If you want to completely block files over a certain size, you can check the size of the file using it’s length property, and handle the result accordingly