Skip to content

Commit 4b85c34

Browse files
Merge pull request #85 from TopiaAmr/main
Solving app crashes on some Huawei phones
2 parents 9117a2b + 756efb6 commit 4b85c34

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/src/form_builder_file_picker.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ class FormBuilderFilePicker
5858
/// Whether to allow file compression
5959
final bool allowCompression;
6060

61+
final int compressionQuality;
62+
6163
/// If [withData] is set, picked files will have its byte data immediately available on memory as [Uint8List]
6264
/// which can be useful if you are picking it for server upload or similar.
6365
final bool withData;
@@ -101,6 +103,7 @@ class FormBuilderFilePicker
101103
this.allowedExtensions,
102104
this.onFileLoading,
103105
this.allowCompression = true,
106+
this.compressionQuality = 30,
104107
this.customFileViewerBuilder,
105108
this.customTypeViewerBuilder})
106109
: super(
@@ -180,6 +183,7 @@ class _FormBuilderFilePickerState extends FormBuilderFieldDecorationState<
180183
type: fileType,
181184
allowedExtensions: widget.allowedExtensions,
182185
allowCompression: widget.allowCompression,
186+
compressionQuality: widget.compressionQuality,
183187
onFileLoading: widget.onFileLoading,
184188
allowMultiple: widget.allowMultiple,
185189
withData: widget.withData,

0 commit comments

Comments
 (0)