@@ -225,24 +225,12 @@ class CameraPickerState extends State<CameraPicker>
225
225
bool get shouldPrepareForVideoRecording =>
226
226
enableRecording && enableAudio && Platform .isIOS;
227
227
228
- bool get enableSetExposure => config.enableSetExposure;
229
-
230
- bool get enableExposureControlOnPoint => config.enableExposureControlOnPoint;
231
-
232
- bool get enablePinchToZoom => config.enablePinchToZoom;
233
-
234
228
bool get enablePullToZoomInRecord =>
235
229
enableRecording && config.enablePullToZoomInRecord;
236
230
237
- bool get shouldDeletePreviewFile => config.shouldDeletePreviewFile;
238
-
239
- bool get shouldAutoPreviewVideo => config.shouldAutoPreviewVideo;
240
-
241
- Duration ? get maximumRecordingDuration => config.maximumRecordingDuration;
242
-
243
231
/// Whether the recording restricted to a specific duration.
244
232
/// 录像是否有限制的时长
245
- bool get isRecordingRestricted => maximumRecordingDuration != null ;
233
+ bool get isRecordingRestricted => config. maximumRecordingDuration != null ;
246
234
247
235
/// A getter to the current [CameraDescription] .
248
236
/// 获取当前相机实例
@@ -526,7 +514,6 @@ class CameraPickerState extends State<CameraPicker>
526
514
if (_pointers != 2 ) {
527
515
return ;
528
516
}
529
-
530
517
zoom (details.scale);
531
518
}
532
519
@@ -753,7 +740,7 @@ class CameraPickerState extends State<CameraPicker>
753
740
try {
754
741
await controller.startVideoRecording ();
755
742
if (isRecordingRestricted) {
756
- _recordCountdownTimer = Timer (maximumRecordingDuration! , () {
743
+ _recordCountdownTimer = Timer (config. maximumRecordingDuration! , () {
757
744
stopRecordingVideo ();
758
745
});
759
746
}
@@ -829,8 +816,8 @@ class CameraPickerState extends State<CameraPicker>
829
816
pickerType: viewType,
830
817
previewXFile: file,
831
818
theme: theme,
832
- shouldDeletePreviewFile: shouldDeletePreviewFile,
833
- shouldAutoPreviewVideo: shouldAutoPreviewVideo,
819
+ shouldDeletePreviewFile: config. shouldDeletePreviewFile,
820
+ shouldAutoPreviewVideo: config. shouldAutoPreviewVideo,
834
821
onEntitySaving: config.onEntitySaving,
835
822
onError: config.onError,
836
823
);
@@ -1096,7 +1083,7 @@ class CameraPickerState extends State<CameraPicker>
1096
1083
(_controller? .value.isRecordingVideo ?? false ) &&
1097
1084
isRecordingRestricted,
1098
1085
builder: (_, __) => CircularProgressBar (
1099
- duration: maximumRecordingDuration! ,
1086
+ duration: config. maximumRecordingDuration! ,
1100
1087
outerRadius: outerSize.width,
1101
1088
ringsColor: theme.indicatorColor,
1102
1089
ringsWidth: 2 ,
@@ -1233,11 +1220,9 @@ class CameraPickerState extends State<CameraPicker>
1233
1220
const double controllerWidth = 20 ;
1234
1221
final double pointWidth = constraints.maxWidth / 5 ;
1235
1222
final double exposureControlWidth =
1236
- enableExposureControlOnPoint ? controllerWidth : 0 ;
1223
+ config. enableExposureControlOnPoint ? controllerWidth : 0 ;
1237
1224
final double width = pointWidth + exposureControlWidth + 2 ;
1238
-
1239
1225
final bool shouldReverseLayout = point.dx > constraints.maxWidth / 4 * 3 ;
1240
-
1241
1226
final double effectiveLeft = math.min (
1242
1227
constraints.maxWidth - width,
1243
1228
math.max (0 , point.dx - width / 2 ),
@@ -1246,7 +1231,6 @@ class CameraPickerState extends State<CameraPicker>
1246
1231
constraints.maxHeight - pointWidth * 3 ,
1247
1232
math.max (0 , point.dy - pointWidth * 3 / 2 ),
1248
1233
);
1249
-
1250
1234
return Positioned (
1251
1235
left: effectiveLeft,
1252
1236
top: effectiveTop,
@@ -1262,8 +1246,8 @@ class CameraPickerState extends State<CameraPicker>
1262
1246
size: pointWidth,
1263
1247
color: theme.iconTheme.color! ,
1264
1248
),
1265
- if (enableExposureControlOnPoint) const SizedBox (width: 2 ),
1266
- if (enableExposureControlOnPoint)
1249
+ if (config. enableExposureControlOnPoint) const SizedBox (width: 2 ),
1250
+ if (config. enableExposureControlOnPoint)
1267
1251
SizedBox .fromSize (
1268
1252
size: Size (exposureControlWidth, pointWidth * 3 ),
1269
1253
child: _buildControl (controllerWidth, pointWidth * 3 ),
@@ -1336,8 +1320,8 @@ class CameraPickerState extends State<CameraPicker>
1336
1320
onPointerDown: (_) => _pointers++ ,
1337
1321
onPointerUp: (_) => _pointers-- ,
1338
1322
child: GestureDetector (
1339
- onScaleStart: enablePinchToZoom ? _handleScaleStart : null ,
1340
- onScaleUpdate: enablePinchToZoom ? _handleScaleUpdate : null ,
1323
+ onScaleStart: config. enablePinchToZoom ? _handleScaleStart : null ,
1324
+ onScaleUpdate: config. enablePinchToZoom ? _handleScaleUpdate : null ,
1341
1325
// Enabled cameras switching by default if we have multiple cameras.
1342
1326
onDoubleTap: cameras.length > 1 ? switchCameras : null ,
1343
1327
child: _controller != null
@@ -1444,14 +1428,14 @@ class CameraPickerState extends State<CameraPicker>
1444
1428
children: < Widget > [
1445
1429
ExcludeSemantics (
1446
1430
child: _initializeWrapper (
1447
- builder: (CameraValue value, __ ) => _cameraBuilder (
1431
+ builder: (CameraValue value, Widget ? w ) => _cameraBuilder (
1448
1432
context: c,
1449
1433
value: value,
1450
1434
constraints: constraints,
1451
1435
),
1452
1436
),
1453
1437
),
1454
- if (enableSetExposure)
1438
+ if (config. enableSetExposure)
1455
1439
_exposureDetectorWidget (c, constraints),
1456
1440
_initializeWrapper (
1457
1441
builder: (CameraValue cameraValue, Widget ? w) {
0 commit comments