1.更换包名
2.调整录制页地址下方时间为当前时间读秒
This commit is contained in:
@@ -21,7 +21,7 @@ class AppConfig {
|
||||
static late EnvironmentValues current;
|
||||
static AppPackageInfo? packageInfo;
|
||||
|
||||
static const appName = '飞行极控';
|
||||
static const appName = '飞行极控录像工作台';
|
||||
static const designSize = Size(375, 812);
|
||||
|
||||
static void configure({
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -56,25 +57,6 @@ class _RecordingPageState extends ConsumerState<RecordingPage> {
|
||||
_immersiveApplied = true;
|
||||
}
|
||||
|
||||
String _clipboardHintLabel(RecordingModel recordingInfo) {
|
||||
if (!recordingInfo.hasValidClipboardInfo) return '';
|
||||
final clip = recordingInfo.clipboardRecordingModel;
|
||||
final lines = <String>[];
|
||||
final address = clip.address.trim();
|
||||
if (address.isNotEmpty) {
|
||||
lines.add(address);
|
||||
}
|
||||
if (clip.startTimestamp > 0) {
|
||||
final startTime = DateTime.fromMillisecondsSinceEpoch(
|
||||
clip.startTimestamp * 1000,
|
||||
).toLocal();
|
||||
lines.add(
|
||||
DateTimeFormatter.format(startTime, pattern: 'yyyy-M-d-H:mm:ss'),
|
||||
);
|
||||
}
|
||||
return lines.join('\n');
|
||||
}
|
||||
|
||||
String _savedDialogSessionTitle(
|
||||
RecordingModel recordingInfo,
|
||||
String? savedName,
|
||||
@@ -178,7 +160,8 @@ class _RecordingPageState extends ConsumerState<RecordingPage> {
|
||||
state: state,
|
||||
eventTitle: showClipboardInfo ? clipboard.title : null,
|
||||
eventAddress: showClipboardInfo ? clipboard.address : null,
|
||||
clipboardHintLabel: _clipboardHintLabel(recordingInfo),
|
||||
showClipboardHint: showClipboardInfo,
|
||||
clipboardAddress: clipboard.address.trim(),
|
||||
onPasteEventInfo: () async {
|
||||
final result = await ref
|
||||
.read(recordingViewModelProvider.notifier)
|
||||
@@ -257,7 +240,8 @@ class _RecordingHud extends StatelessWidget {
|
||||
required this.state,
|
||||
this.eventTitle,
|
||||
this.eventAddress,
|
||||
this.clipboardHintLabel,
|
||||
this.showClipboardHint = false,
|
||||
this.clipboardAddress = '',
|
||||
required this.onPasteEventInfo,
|
||||
required this.onStart,
|
||||
required this.onStop,
|
||||
@@ -269,7 +253,8 @@ class _RecordingHud extends StatelessWidget {
|
||||
final RecordingSessionState state;
|
||||
final String? eventTitle;
|
||||
final String? eventAddress;
|
||||
final String? clipboardHintLabel;
|
||||
final bool showClipboardHint;
|
||||
final String clipboardAddress;
|
||||
final Future<void> Function() onPasteEventInfo;
|
||||
final VoidCallback onStart;
|
||||
final VoidCallback onStop;
|
||||
@@ -330,7 +315,8 @@ class _RecordingHud extends StatelessWidget {
|
||||
hasDndAccess: state.hasDndAccess,
|
||||
isBatteryIgnored: state.isBatteryOptimizedIgnored,
|
||||
notificationsGranted: state.notificationsGranted,
|
||||
clipboardHintLabel: clipboardHintLabel,
|
||||
showClipboardHint: showClipboardHint,
|
||||
clipboardAddress: clipboardAddress,
|
||||
onOpenDnd: onOpenDnd,
|
||||
onOpenBattery: onOpenBattery,
|
||||
onOpenNotificationSettings: openAppSettings,
|
||||
@@ -485,7 +471,8 @@ class _SetupHints extends StatelessWidget {
|
||||
required this.hasDndAccess,
|
||||
required this.isBatteryIgnored,
|
||||
required this.notificationsGranted,
|
||||
this.clipboardHintLabel,
|
||||
this.showClipboardHint = false,
|
||||
this.clipboardAddress = '',
|
||||
required this.onOpenDnd,
|
||||
required this.onOpenBattery,
|
||||
required this.onOpenNotificationSettings,
|
||||
@@ -494,7 +481,8 @@ class _SetupHints extends StatelessWidget {
|
||||
final bool hasDndAccess;
|
||||
final bool isBatteryIgnored;
|
||||
final bool notificationsGranted;
|
||||
final String? clipboardHintLabel;
|
||||
final bool showClipboardHint;
|
||||
final String clipboardAddress;
|
||||
final VoidCallback onOpenDnd;
|
||||
final VoidCallback onOpenBattery;
|
||||
final VoidCallback onOpenNotificationSettings;
|
||||
@@ -503,8 +491,7 @@ class _SetupHints extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final showPermissionHints =
|
||||
!hasDndAccess || !isBatteryIgnored || !notificationsGranted;
|
||||
final showClipboardHint =
|
||||
clipboardHintLabel != null && clipboardHintLabel!.isNotEmpty;
|
||||
final showClipboardHint = this.showClipboardHint;
|
||||
if (!showPermissionHints && !showClipboardHint) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
@@ -526,10 +513,9 @@ class _SetupHints extends StatelessWidget {
|
||||
SizedBox(height: 8.h),
|
||||
_HintChip(label: '关闭电池优化可提升息屏续录稳定性', onTap: onOpenBattery),
|
||||
],
|
||||
if (clipboardHintLabel != null &&
|
||||
clipboardHintLabel!.isNotEmpty) ...[
|
||||
if (showClipboardHint) ...[
|
||||
SizedBox(height: 8.h),
|
||||
_HintChip(label: clipboardHintLabel!, onTap: () {}),
|
||||
_ClipboardAddressClockChip(address: clipboardAddress),
|
||||
],
|
||||
],
|
||||
),
|
||||
@@ -537,6 +523,49 @@ class _SetupHints extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _ClipboardAddressClockChip extends StatefulWidget {
|
||||
const _ClipboardAddressClockChip({required this.address});
|
||||
|
||||
final String address;
|
||||
|
||||
@override
|
||||
State<_ClipboardAddressClockChip> createState() =>
|
||||
_ClipboardAddressClockChipState();
|
||||
}
|
||||
|
||||
class _ClipboardAddressClockChipState extends State<_ClipboardAddressClockChip> {
|
||||
Timer? _clockTimer;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_clockTimer = Timer.periodic(const Duration(seconds: 1), (_) {
|
||||
if (mounted) setState(() {});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_clockTimer?.cancel();
|
||||
_clockTimer = null;
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
String _buildLabel() {
|
||||
final nowText = DateTimeFormatter.format(
|
||||
DateTime.now(),
|
||||
pattern: 'yyyy-M-d-H:mm:ss',
|
||||
);
|
||||
if (widget.address.isEmpty) return nowText;
|
||||
return '${widget.address}\n$nowText';
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return _HintChip(label: _buildLabel(), onTap: () {});
|
||||
}
|
||||
}
|
||||
|
||||
class _HintChip extends StatelessWidget {
|
||||
const _HintChip({required this.label, required this.onTap});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user