feat: implement LAN multi-device synchronization and dedicated sync server

This commit is contained in:
shen
2026-10-27 02:52:28 -07:00
parent 6e9477f015
commit ef56202777
10 changed files with 1005 additions and 1 deletions
+28
View File
@@ -3,6 +3,7 @@ import '../models/app_settings.dart';
import '../services/storage_service.dart';
import '../services/tts_service.dart';
import 'plan_config_screen.dart';
import 'lan_sync_screen.dart';
class SettingsScreen extends StatefulWidget {
final StorageService storageService;
@@ -137,6 +138,33 @@ class _SettingsScreenState extends State<SettingsScreen> {
),
),
const SizedBox(height: 12),
// 局域网多设备同步入口卡
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
border: Border.all(color: const Color(0xFFBFDBFE)),
boxShadow: [
BoxShadow(color: Colors.black.withValues(alpha: 0.02), blurRadius: 6, offset: const Offset(0, 2)),
],
),
child: ListTile(
leading: const Icon(Icons.sync, color: Color(0xFF2563EB), size: 26),
title: const Text('局域网多设备同步', style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14)),
subtitle: const Text('家庭私有化同步 • 离开家离线打卡,回家自动合并', style: TextStyle(fontSize: 11, color: Colors.grey)),
trailing: const Icon(Icons.chevron_right, color: Colors.grey),
onTap: () async {
await Navigator.of(context).push(
MaterialPageRoute(
builder: (_) => LanSyncScreen(storageService: widget.storageService),
),
);
},
),
),
const SizedBox(height: 24),
// 模块 2:提醒偏好