feat: complete academic symbol lexicon heal, 2-column Cooper extraction, and updated assets
This commit is contained in:
@@ -0,0 +1,157 @@
|
||||
# 1. Update lib/widgets/word_card_widget.dart
|
||||
with open('lib/widgets/word_card_widget.dart', 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
||||
# Replace faulty _shareWord
|
||||
import re
|
||||
new_share_word = ''' void _shareWord(BuildContext context) {
|
||||
final buffer = StringBuffer();
|
||||
buffer.writeln('🔮 ОРАКУЛ • САХРАЛЬНЫЙ ЗНАК #${widget.word.formattedSessionNumber}');
|
||||
buffer.writeln('«${widget.word.word.toUpperCase()}» ${widget.word.emoji}');
|
||||
if (widget.word.category.isNotEmpty) {
|
||||
buffer.writeln('Категория: ${widget.word.category}');
|
||||
}
|
||||
buffer.writeln('');
|
||||
if (widget.word.core.isNotEmpty) {
|
||||
buffer.writeln('📖 Суть:');
|
||||
buffer.writeln(widget.word.core);
|
||||
buffer.writeln('');
|
||||
}
|
||||
buffer.writeln('🔮 Толкование:');
|
||||
buffer.writeln(widget.word.description);
|
||||
if (_aiInterpretation != null && _aiInterpretation!.isNotEmpty) {
|
||||
buffer.writeln('');
|
||||
buffer.writeln('🤖 Персональный отклик Оракула:');
|
||||
buffer.writeln(_aiInterpretation);
|
||||
}
|
||||
buffer.writeln('');
|
||||
buffer.writeln('— Система сакрального жребия «Оракул»');
|
||||
|
||||
Clipboard.setData(ClipboardData(text: buffer.toString()));
|
||||
HapticFeedback.lightImpact();
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Row(
|
||||
children: [
|
||||
const Icon(Icons.share_rounded, color: Color(0xFFFFD54F), size: 18),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(child: Text('Символ «${widget.word.word}» скопирован для отправки!')),
|
||||
],
|
||||
),
|
||||
duration: const Duration(seconds: 2),
|
||||
behavior: SnackBarBehavior.floating,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
),
|
||||
);
|
||||
}'''
|
||||
|
||||
content = re.sub(r' void _shareWord\(BuildContext context\) \{.*?\n \}', new_share_word, content, flags=re.DOTALL)
|
||||
with open('lib/widgets/word_card_widget.dart', 'w', encoding='utf-8') as f:
|
||||
f.write(content)
|
||||
|
||||
# 2. Update lib/screens/symbol_detail_screen.dart
|
||||
with open('lib/screens/symbol_detail_screen.dart', 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
||||
new_share_symbol = ''' void _shareSymbol() {
|
||||
final w = _currentWord;
|
||||
final buffer = StringBuffer();
|
||||
buffer.writeln('🔮 ОРАКУЛ • САХРАЛЬНЫЙ ЗНАК #${w.formattedSessionNumber}');
|
||||
buffer.writeln('«${w.word.toUpperCase()}» ${w.emoji}');
|
||||
if (w.category.isNotEmpty) {
|
||||
buffer.writeln('Категория: ${w.category}');
|
||||
}
|
||||
buffer.writeln('');
|
||||
if (w.core.isNotEmpty) {
|
||||
buffer.writeln('📖 Суть:');
|
||||
buffer.writeln(w.core);
|
||||
buffer.writeln('');
|
||||
}
|
||||
buffer.writeln('🔮 Толкование:');
|
||||
buffer.writeln(w.description);
|
||||
buffer.writeln('');
|
||||
buffer.writeln('— Система сакрального жребия «Оракул»');
|
||||
|
||||
Clipboard.setData(ClipboardData(text: buffer.toString()));
|
||||
HapticFeedback.lightImpact();
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Row(
|
||||
children: [
|
||||
const Icon(Icons.share_rounded, color: Color(0xFFFFD54F), size: 18),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(child: Text('Символ «${w.word}» скопирован для отправки!')),
|
||||
],
|
||||
),
|
||||
duration: const Duration(seconds: 2),
|
||||
behavior: SnackBarBehavior.floating,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
),
|
||||
);
|
||||
}'''
|
||||
|
||||
content = re.sub(r' void _shareSymbol\(\) \{.*?\n \}', new_share_symbol, content, flags=re.DOTALL)
|
||||
with open('lib/screens/symbol_detail_screen.dart', 'w', encoding='utf-8') as f:
|
||||
f.write(content)
|
||||
|
||||
# 3. Update lib/screens/manual_dive_screen.dart
|
||||
with open('lib/screens/manual_dive_screen.dart', 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
||||
new_share_passport = ''' void _sharePassport(WordItem word) {
|
||||
final buffer = StringBuffer();
|
||||
buffer.writeln('🔮 ОРАКУЛ • ПАСПОРТ СИМВОЛА #${word.formattedSessionNumber}');
|
||||
buffer.writeln('«${word.word.toUpperCase()}» ${word.emoji}');
|
||||
if (word.category.isNotEmpty) {
|
||||
buffer.writeln('Категория: ${word.category}');
|
||||
}
|
||||
buffer.writeln('');
|
||||
if (word.core.isNotEmpty) {
|
||||
buffer.writeln('📖 Суть:');
|
||||
buffer.writeln(word.core);
|
||||
buffer.writeln('');
|
||||
}
|
||||
buffer.writeln('🔮 Базовое толкование:');
|
||||
buffer.writeln(word.description);
|
||||
buffer.writeln('');
|
||||
final passport = _repo.getPassport(word.id);
|
||||
if (passport != null) {
|
||||
final f = passport.fields;
|
||||
final sm = f['sacred_meaning']?.toString() ?? '';
|
||||
if (sm.isNotEmpty) {
|
||||
buffer.writeln('✨ Сакральный смысл:');
|
||||
buffer.writeln(sm);
|
||||
buffer.writeln('');
|
||||
}
|
||||
final arch = f['archetype']?.toString() ?? '';
|
||||
if (arch.isNotEmpty) {
|
||||
buffer.writeln('🏛 Архетип:');
|
||||
buffer.writeln(arch);
|
||||
buffer.writeln('');
|
||||
}
|
||||
}
|
||||
buffer.writeln('— Система сакрального жребия «Оракул»');
|
||||
|
||||
Clipboard.setData(ClipboardData(text: buffer.toString()));
|
||||
HapticFeedback.lightImpact();
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Row(
|
||||
children: [
|
||||
const Icon(Icons.share_rounded, color: Color(0xFFFFD54F), size: 18),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(child: Text('Паспорт «${word.word}» скопирован для отправки!')),
|
||||
],
|
||||
),
|
||||
duration: const Duration(seconds: 2),
|
||||
behavior: SnackBarBehavior.floating,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
),
|
||||
);
|
||||
}'''
|
||||
|
||||
content = re.sub(r' void _sharePassport\(WordItem word\) \{.*?\n \}', new_share_passport, content, flags=re.DOTALL)
|
||||
with open('lib/screens/manual_dive_screen.dart', 'w', encoding='utf-8') as f:
|
||||
f.write(content)
|
||||
|
||||
print("Fixed syntax in all share methods!")
|
||||
Reference in New Issue
Block a user