1.确定 APP 包名
2.录制结束增加弹窗提示 3.完成读取剪切板内容、新增粘贴剪切板内容
This commit is contained in:
120
lib/features/recording/widgets/recording_saved_dialog.dart
Normal file
120
lib/features/recording/widgets/recording_saved_dialog.dart
Normal file
@@ -0,0 +1,120 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
|
||||
/// 录制结束并保存到相册后的后续操作弹窗。
|
||||
Future<void> showRecordingSavedDialog(
|
||||
BuildContext context, {
|
||||
required String sessionTitle,
|
||||
required VoidCallback onContinueRound,
|
||||
required VoidCallback onRecordNewRound,
|
||||
}) {
|
||||
return showDialog<void>(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (dialogContext) {
|
||||
return _RecordingSavedDialog(
|
||||
sessionTitle: sessionTitle,
|
||||
onContinueRound: () {
|
||||
Navigator.of(dialogContext).pop();
|
||||
onContinueRound();
|
||||
},
|
||||
onRecordNewRound: () {
|
||||
Navigator.of(dialogContext).pop();
|
||||
onRecordNewRound();
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
class _RecordingSavedDialog extends StatelessWidget {
|
||||
const _RecordingSavedDialog({
|
||||
required this.sessionTitle,
|
||||
required this.onContinueRound,
|
||||
required this.onRecordNewRound,
|
||||
});
|
||||
|
||||
final String sessionTitle;
|
||||
final VoidCallback onContinueRound;
|
||||
final VoidCallback onRecordNewRound;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Dialog(
|
||||
backgroundColor: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(4.r),
|
||||
side: const BorderSide(color: Colors.black, width: 1),
|
||||
),
|
||||
insetPadding: EdgeInsets.symmetric(horizontal: 32.w),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(20.w, 20.h, 20.w, 16.h),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
sessionTitle,
|
||||
style: TextStyle(
|
||||
fontSize: 15.sp,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.black87,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
SizedBox(height: 16.h),
|
||||
Text(
|
||||
'本轮比赛视频已保存到相册',
|
||||
style: TextStyle(fontSize: 14.sp, color: Colors.black87),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
SizedBox(height: 8.h),
|
||||
// Text(
|
||||
// '请选择后续录制信息',
|
||||
// style: TextStyle(fontSize: 14.sp, color: Colors.black87),
|
||||
// textAlign: TextAlign.center,
|
||||
// ),
|
||||
SizedBox(height: 20.h),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _DialogActionButton(
|
||||
label: '继续本轮',
|
||||
onPressed: onContinueRound,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 12.w),
|
||||
Expanded(
|
||||
child: _DialogActionButton(
|
||||
label: '录制新轮',
|
||||
onPressed: onRecordNewRound,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _DialogActionButton extends StatelessWidget {
|
||||
const _DialogActionButton({required this.label, required this.onPressed});
|
||||
|
||||
final String label;
|
||||
final VoidCallback onPressed;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return TextButton(
|
||||
onPressed: onPressed,
|
||||
style: TextButton.styleFrom(
|
||||
backgroundColor: const Color(0xFFE8E8E8),
|
||||
foregroundColor: Colors.black87,
|
||||
padding: EdgeInsets.symmetric(vertical: 10.h),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6.r)),
|
||||
),
|
||||
child: Text(label, style: TextStyle(fontSize: 14.sp)),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user