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