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