Fix resolution of images uploading

This commit is contained in:
hanie.khodkari
2025-06-12 02:44:28 +03:30
parent 1a60d80840
commit fffcdf36bf
2 changed files with 26 additions and 15 deletions
@@ -11,6 +11,7 @@ import 'package:provider/provider.dart';
class UploaderImage extends StatefulWidget {
final double deviceBlockSize;
final ItemProvider providerObject;
const UploaderImage({
super.key,
required this.deviceBlockSize,
@@ -95,7 +96,10 @@ class _UploaderImageState extends State<UploaderImage> {
var image = await ImagePicker.platform.pickImage(
source: ImageSource.gallery,
imageQuality: 25,
maxHeight: 1080,
maxWidth: 1920,
);
print('Picked image size (bytes): ${await image?.path.length}');
if (image != null) {
files.add(
PlatformFile(
@@ -116,6 +120,8 @@ class _UploaderImageState extends State<UploaderImage> {
var image = await ImagePicker.platform.pickImage(
source: ImageSource.camera,
imageQuality: 25,
maxHeight: 1080,
maxWidth: 1920,
);
if (image != null) {
_catchImages.add(
@@ -697,7 +697,10 @@ class _FormCreatorState extends State<FormCreator> {
var image = await ImagePicker.platform.pickImage(
source: ImageSource.gallery,
imageQuality: 25,
maxHeight: 1080,
maxWidth: 1920,
);
print('Picked image size (bytes) in test: ${await image?.path.length}');
if (image != null) {
files.add(
PlatformFile(
@@ -719,6 +722,8 @@ class _FormCreatorState extends State<FormCreator> {
var image = await ImagePicker.platform.pickImage(
source: ImageSource.camera,
imageQuality: 25,
maxHeight: 1080,
maxWidth: 1920,
);
if (image != null) {
_catchImages.add(