新增删除剪切板内容功能
This commit is contained in:
@@ -98,6 +98,13 @@ class _RecordingPageState extends ConsumerState<RecordingPage> {
|
||||
await ref.read(recordingSessionControllerProvider.notifier).startRecording();
|
||||
}
|
||||
|
||||
void _clearClipboardForNewRound() {
|
||||
ref.read(recordingViewModelProvider.notifier).resetClipboardInfo();
|
||||
ref
|
||||
.read(recordingSessionControllerProvider.notifier)
|
||||
.clearSavedRecordingResult();
|
||||
}
|
||||
|
||||
Future<void> _showRecordingSavedDialogIfNeeded() async {
|
||||
final session = ref.read(recordingSessionControllerProvider);
|
||||
if (session.lastSavedDisplayName == null || session.gallerySaveFailed) {
|
||||
@@ -118,12 +125,7 @@ class _RecordingPageState extends ConsumerState<RecordingPage> {
|
||||
.read(recordingSessionControllerProvider.notifier)
|
||||
.clearSavedRecordingResult();
|
||||
},
|
||||
onRecordNewRound: () {
|
||||
ref.read(recordingViewModelProvider.notifier).resetClipboardInfo();
|
||||
ref
|
||||
.read(recordingSessionControllerProvider.notifier)
|
||||
.clearSavedRecordingResult();
|
||||
},
|
||||
onRecordNewRound: _clearClipboardForNewRound,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -188,6 +190,7 @@ class _RecordingPageState extends ConsumerState<RecordingPage> {
|
||||
eventAddress: showClipboardInfo ? clipboard.address : null,
|
||||
showClipboardHint: showClipboardInfo,
|
||||
clipboardAddress: clipboard.address.trim(),
|
||||
onClearEventInfo: _clearClipboardForNewRound,
|
||||
onPasteEventInfo: () async {
|
||||
final result = await ref
|
||||
.read(recordingViewModelProvider.notifier)
|
||||
@@ -268,6 +271,7 @@ class _RecordingHud extends StatelessWidget {
|
||||
this.eventAddress,
|
||||
this.showClipboardHint = false,
|
||||
this.clipboardAddress = '',
|
||||
required this.onClearEventInfo,
|
||||
required this.onPasteEventInfo,
|
||||
required this.onStart,
|
||||
required this.onStop,
|
||||
@@ -281,6 +285,7 @@ class _RecordingHud extends StatelessWidget {
|
||||
final String? eventAddress;
|
||||
final bool showClipboardHint;
|
||||
final String clipboardAddress;
|
||||
final VoidCallback onClearEventInfo;
|
||||
final Future<void> Function() onPasteEventInfo;
|
||||
final Future<void> Function() onStart;
|
||||
final Future<void> Function() onStop;
|
||||
@@ -446,15 +451,36 @@ class _RecordingHud extends StatelessWidget {
|
||||
right: 12.w,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(right: state.isRecording ? 96.w : 0),
|
||||
child: Text(
|
||||
eventTitle!,
|
||||
style: _overlayTextStyle.copyWith(
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
eventTitle!,
|
||||
style: _overlayTextStyle.copyWith(
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
if (!state.isRecording)
|
||||
IconButton(
|
||||
onPressed: onClearEventInfo,
|
||||
icon: Icon(
|
||||
Icons.delete_outline,
|
||||
color: Colors.white,
|
||||
size: 22.r,
|
||||
),
|
||||
padding: EdgeInsets.zero,
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 40.r,
|
||||
minHeight: 40.r,
|
||||
),
|
||||
tooltip: '删除',
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user