优化了 启动录制效果
This commit is contained in:
@@ -96,6 +96,15 @@ class RecordingCameraController(
|
||||
return
|
||||
}
|
||||
|
||||
if (
|
||||
boundLifecycleOwner === lifecycleOwner &&
|
||||
preview != null &&
|
||||
videoCapture != null
|
||||
) {
|
||||
onReady(true)
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
boundLifecycleOwner = lifecycleOwner
|
||||
provider.unbindAll()
|
||||
|
||||
@@ -298,7 +298,10 @@ class _RecordingPageState extends ConsumerState<RecordingPage> {
|
||||
onUnlocked: () => viewModel.setTouchLocked(false),
|
||||
),
|
||||
if (state.isStartingRecording)
|
||||
const RecordingLoadingOverlayWidget(message: '正在开始录制…'),
|
||||
RecordingLoadingOverlayWidget(
|
||||
message: '正在开始录制…',
|
||||
backgroundColor: Colors.black.withValues(alpha: 0.24),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -46,8 +46,8 @@ class RecordingControlButton extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOutCubic,
|
||||
duration: const Duration(milliseconds: 500),
|
||||
curve: Curves.ease,
|
||||
width: innerSize,
|
||||
height: innerSize,
|
||||
decoration: BoxDecoration(
|
||||
|
||||
@@ -3,15 +3,20 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
|
||||
/// 录制加载遮罩(相机启动/开始录制)
|
||||
class RecordingLoadingOverlayWidget extends StatelessWidget {
|
||||
const RecordingLoadingOverlayWidget({super.key, required this.message});
|
||||
const RecordingLoadingOverlayWidget({
|
||||
super.key,
|
||||
required this.message,
|
||||
this.backgroundColor = Colors.black,
|
||||
});
|
||||
|
||||
final String message;
|
||||
final Color backgroundColor;
|
||||
|
||||
@override
|
||||
/// 显示加载动画与提示文案
|
||||
Widget build(BuildContext context) {
|
||||
return ColoredBox(
|
||||
color: Colors.black,
|
||||
color: backgroundColor,
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
||||
Reference in New Issue
Block a user