@@ -143,12 +143,12 @@ class _CameraPickerState extends State<CameraPicker> {
143
143
/// 当长按拍照按钮时,会进入准备录制视频的状态,此时需要执行动画。
144
144
bool isShootingButtonAnimate = false ;
145
145
146
- /// Whether the recording progress should display .
147
- /// 视频录制的进度是否显示
146
+ /// Whether the recording progress started .
147
+ /// 是否已开始录制视频
148
148
///
149
149
/// After [shootingButton] animated, the [CircleProgressBar] will become visible.
150
150
/// 当拍照按钮动画执行结束后,进度将变为可见状态并开始更新其状态。
151
- bool isShowingProgress = false ;
151
+ bool isRecording = false ;
152
152
153
153
/// The [Timer] for record start detection.
154
154
/// 用于检测是否开始录制的定时器
@@ -363,7 +363,9 @@ class _CameraPickerState extends State<CameraPicker> {
363
363
height: Screens .width / 3.5 ,
364
364
child: Row (
365
365
children: < Widget > [
366
- Expanded (child: Center (child: backButton)),
366
+ Expanded (
367
+ child: ! isRecording ? Center (child: backButton) : const SizedBox .shrink (),
368
+ ),
367
369
Expanded (child: Center (child: shootingButton)),
368
370
const Spacer (),
369
371
],
@@ -404,8 +406,8 @@ class _CameraPickerState extends State<CameraPicker> {
404
406
behavior: HitTestBehavior .opaque,
405
407
onPointerUp: (PointerUpEvent event) {
406
408
recordDetectTimer? .cancel ();
407
- if (isShowingProgress ) {
408
- isShowingProgress = false ;
409
+ if (isRecording ) {
410
+ isRecording = false ;
409
411
if (mounted) {
410
412
setState (() {});
411
413
}
@@ -422,7 +424,7 @@ class _CameraPickerState extends State<CameraPicker> {
422
424
onTap: () {},
423
425
onLongPress: () {
424
426
recordDetectTimer = Timer (recordDetectDuration, () {
425
- isShowingProgress = true ;
427
+ isRecording = true ;
426
428
if (mounted) {
427
429
setState (() {});
428
430
}
@@ -458,7 +460,7 @@ class _CameraPickerState extends State<CameraPicker> {
458
460
),
459
461
),
460
462
),
461
- if (isShowingProgress )
463
+ if (isRecording )
462
464
CircleProgressBar (
463
465
duration: 15. seconds,
464
466
outerRadius: outerSize.width,
0 commit comments