fix(upload_image): 限制拍摄图片的尺寸和质量
- 在使用相机拍照时设置最大高度为1080像素 - 设置最大宽度为1920像素以控制图片尺寸 - 调整图片质量为80以优化图片大小与清晰度 - 确保用户取消拍摄时正常返回
This commit is contained in:
@@ -232,6 +232,9 @@ class UploadImagesTool {
|
|||||||
}) async {
|
}) async {
|
||||||
XFile? file = await ImagePicker().pickImage(
|
XFile? file = await ImagePicker().pickImage(
|
||||||
source: ImageSource.camera,
|
source: ImageSource.camera,
|
||||||
|
maxHeight: 1080,
|
||||||
|
maxWidth: 1920,
|
||||||
|
imageQuality: 80
|
||||||
);
|
);
|
||||||
if (file == null) {
|
if (file == null) {
|
||||||
Get.back();
|
Get.back();
|
||||||
|
|||||||
Reference in New Issue
Block a user