fix: merge duplicate symbols, expand Zoroastrian citations, add reading deletion to sessions, and deduplicate Word of the Day
This commit is contained in:
@@ -152,6 +152,35 @@ class _CrossSystemComparisonScreenState extends State<CrossSystemComparisonScree
|
||||
);
|
||||
}
|
||||
|
||||
void _confirmDeleteReading(SyncreticReading reading) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (ctx) => AlertDialog(
|
||||
backgroundColor: const Color(0xFF151829),
|
||||
title: const Text('Удалить расклад?', style: TextStyle(color: Color(0xFFFFF9C4), fontSize: 16, fontWeight: FontWeight.bold)),
|
||||
content: Text('Удалить «${reading.systemName} (${reading.layoutTitle})» из текущей сессии дня?', style: const TextStyle(color: Color(0xFFECEFF1), fontSize: 13)),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(ctx),
|
||||
child: const Text('Отмена', style: TextStyle(color: Color(0xFF8C93B8))),
|
||||
),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(backgroundColor: const Color(0xFFEF5350), foregroundColor: Colors.white),
|
||||
onPressed: () async {
|
||||
Navigator.pop(ctx);
|
||||
await _repo.removeReadingFromSyncreticSession(reading.id);
|
||||
setState(() {
|
||||
_session = _repo.currentSyncreticSession;
|
||||
});
|
||||
HapticFeedback.mediumImpact();
|
||||
},
|
||||
child: const Text('Удалить'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final readings = _session.readings;
|
||||
@@ -332,6 +361,11 @@ class _CrossSystemComparisonScreenState extends State<CrossSystemComparisonScree
|
||||
],
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.close_rounded, size: 20, color: Color(0xFFEF5350)),
|
||||
tooltip: 'Удалить из сессии',
|
||||
onPressed: () => _confirmDeleteReading(reading),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
@@ -415,22 +415,6 @@ class _DivinationHubScreenState extends State<DivinationHubScreen> {
|
||||
// Section 1: Core 999 Systems
|
||||
_buildSectionHeader('СИСТЕМЫ ОРАКУЛА 999', Icons.auto_awesome_rounded),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildSystemCard(
|
||||
title: 'Слово Дня',
|
||||
instructionId: 'word_of_day',
|
||||
subtitle: 'Календарь & Квест',
|
||||
icon: '☀️',
|
||||
desc: 'Ежедневный архетип, коан для ума, микродействие и дневник',
|
||||
accentColor: const Color(0xFFFFD54F),
|
||||
onTap: () => Navigator.push(context, MaterialPageRoute(builder: (_) => const WordOfTheDayScreen())).then((_) => setState(() {})),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
|
||||
@@ -715,6 +715,13 @@ class WordsRepository {
|
||||
await saveSyncreticSession(updatedSession);
|
||||
}
|
||||
|
||||
Future<void> removeReadingFromSyncreticSession(String readingId) async {
|
||||
final current = currentSyncreticSession;
|
||||
final updatedReadings = current.readings.where((r) => r.id != readingId).toList();
|
||||
final updatedSession = current.copyWith(readings: updatedReadings);
|
||||
await saveSyncreticSession(updatedSession);
|
||||
}
|
||||
|
||||
Future<void> saveSyncreticSession(SyncreticSession session) async {
|
||||
_currentSyncreticSession = session;
|
||||
final idx = _syncreticSessions.indexWhere((s) => s.id == session.id);
|
||||
|
||||
Reference in New Issue
Block a user