@@ -38,6 +38,7 @@ class CameraPicker extends StatefulWidget {
38
38
this .maximumRecordingDuration = const Duration (seconds: 15 ),
39
39
this .theme,
40
40
this .resolutionPreset = ResolutionPreset .max,
41
+ this .imageFormatGroup = ImageFormatGroup .jpeg,
41
42
this .cameraQuarterTurns = 0 ,
42
43
this .foregroundBuilder,
43
44
CameraPickerTextDelegate textDelegate,
@@ -108,6 +109,13 @@ class CameraPicker extends StatefulWidget {
108
109
/// 相机的分辨率预设
109
110
final ResolutionPreset resolutionPreset;
110
111
112
+ /// The [ImageFormatGroup] describes the output of the raw image format.
113
+ /// 输出图像的格式描述
114
+ ///
115
+ /// When null the imageFormat will fallback to the platforms default.
116
+ /// 为空时将使用平台默认值
117
+ final ImageFormatGroup imageFormatGroup;
118
+
111
119
/// The foreground widget builder which will cover the whole camera preview.
112
120
/// 覆盖在相机预览上方的前景构建
113
121
final Widget Function (CameraValue ) foregroundBuilder;
@@ -127,6 +135,7 @@ class CameraPicker extends StatefulWidget {
127
135
int cameraQuarterTurns = 0 ,
128
136
CameraPickerTextDelegate textDelegate,
129
137
ResolutionPreset resolutionPreset = ResolutionPreset .max,
138
+ ImageFormatGroup imageFormatGroup = ImageFormatGroup .jpeg,
130
139
Widget Function (CameraValue ) foregroundBuilder,
131
140
}) async {
132
141
if (enableRecording != true && onlyEnableRecording == true ) {
@@ -152,6 +161,7 @@ class CameraPicker extends StatefulWidget {
152
161
cameraQuarterTurns: cameraQuarterTurns,
153
162
textDelegate: textDelegate,
154
163
resolutionPreset: resolutionPreset,
164
+ imageFormatGroup: imageFormatGroup,
155
165
foregroundBuilder: foregroundBuilder,
156
166
),
157
167
transitionCurve: Curves .easeIn,
@@ -449,6 +459,7 @@ class CameraPickerState extends State<CameraPicker>
449
459
cameraDescription ?? cameras[0 ],
450
460
widget.resolutionPreset,
451
461
enableAudio: enableAudio,
462
+ imageFormatGroup: widget.imageFormatGroup,
452
463
)..addListener (() {
453
464
if (controller.value.hasError) {
454
465
realDebugPrint ('Camera error ${controller .value .errorDescription }' );
0 commit comments