From e861b3c8e78debdebb86b169d29a5c9ff4d9f4c7 Mon Sep 17 00:00:00 2001 From: needle10 Date: Sun, 30 Nov 2025 19:05:03 +0300 Subject: [PATCH 1/4] =?UTF-8?q?=D0=B2=D0=B5=D1=80=D1=81=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B0=20=D0=BD=D0=B0?= =?UTF-8?q?=200.3.0,=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB=20=D0=BA?= =?UTF-8?q?=D0=BD=D0=BE=D0=BF=D0=BA=D1=83=20=D1=80=D0=B5=D0=B3=D0=B8=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=8D=D0=BA=D1=80=D0=B0=D0=BD=D0=B5=20=D0=B2?= =?UTF-8?q?=D1=85=D0=BE=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...kotlin-compiler-9339312346383169436.salive | 0 lib/consts.dart | 2 +- lib/screens/phone_entry_screen.dart | 32 +++++++------------ pubspec.yaml | 2 +- 4 files changed, 14 insertions(+), 22 deletions(-) delete mode 100644 android/.kotlin/sessions/kotlin-compiler-9339312346383169436.salive diff --git a/android/.kotlin/sessions/kotlin-compiler-9339312346383169436.salive b/android/.kotlin/sessions/kotlin-compiler-9339312346383169436.salive deleted file mode 100644 index e69de29..0000000 diff --git a/lib/consts.dart b/lib/consts.dart index 7d0937f..4d18362 100644 --- a/lib/consts.dart +++ b/lib/consts.dart @@ -1,2 +1,2 @@ // Датафайл с константами, полезно при изменении версии например -const version = "0.3.0"; \ No newline at end of file +const version = "0.3.0"; diff --git a/lib/screens/phone_entry_screen.dart b/lib/screens/phone_entry_screen.dart index 9100dcd..1c46fee 100644 --- a/lib/screens/phone_entry_screen.dart +++ b/lib/screens/phone_entry_screen.dart @@ -480,12 +480,11 @@ class _PhoneEntryScreenState extends State onCountryChanged: _onCountryChanged, customPrefix: _customPrefix, ), - - (Platform.instance.android || Platform.instance.windows) ? Column( - children: [ + + if (Platform.instance.android || + Platform.instance.windows) ...[ const SizedBox(height: 16), - Center( - child: TextButton( + OutlinedButton( onPressed: _isTosAccepted ? () { Navigator.of(context).push( @@ -496,26 +495,19 @@ class _PhoneEntryScreenState extends State ); } : null, + style: OutlinedButton.styleFrom( + padding: const EdgeInsets.symmetric( + vertical: 16, + ), + ), child: Text( - 'зарегистрироваться', + 'Зарегистрироваться', style: GoogleFonts.manrope( - color: _isTosAccepted - ? colors.primary - : colors.onSurfaceVariant.withOpacity( - 0.5, - ), - fontWeight: FontWeight.w600, - decoration: TextDecoration.underline, - decorationColor: _isTosAccepted - ? colors.primary - : colors.onSurfaceVariant.withOpacity( - 0.5, - ), + fontWeight: FontWeight.bold, ), ), ), - )] - ) : const SizedBox(), + ], const SizedBox(height: 16), Row( crossAxisAlignment: CrossAxisAlignment.center, diff --git a/pubspec.yaml b/pubspec.yaml index 634a56b..493ab32 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 0.2.0+4 +version: 0.3.0+6 environment: sdk: ^3.9.2 From e7ff7af96f1049457bf0a39975b738f00c0dfbab Mon Sep 17 00:00:00 2001 From: ivan2282 Date: Sun, 30 Nov 2025 19:41:36 +0300 Subject: [PATCH 2/4] Fix crash --- lib/api/api_service_auth.dart | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/api/api_service_auth.dart b/lib/api/api_service_auth.dart index 39f3323..4a3b199 100644 --- a/lib/api/api_service_auth.dart +++ b/lib/api/api_service_auth.dart @@ -146,21 +146,21 @@ extension ApiServiceAuth on ApiService { if (currentAccount != null) { authToken = currentAccount.token; userId = currentAccount.userId; - print( - "Токен загружен из AccountManager: ${authToken!.substring(0, 20)}...", - ); + // print( + // "Токен загружен из AccountManager: ${authToken!.substring(0, 20)}...", + // ); } else { final prefs = await SharedPreferences.getInstance(); authToken = prefs.getString('authToken'); userId = prefs.getString('userId'); - if (authToken != null) { - print( - "Токен загружен из SharedPreferences: ${authToken!.substring(0, 20)}...", - ); - if (userId != null) { - print("UserID загружен из SharedPreferences: $userId"); - } - } + // if (authToken != null) { + // print( + // "Токен загружен из SharedPreferences: ${authToken!.substring(0, 20)}...", + // ); + // if (userId != null) { + // print("UserID загружен из SharedPreferences: $userId"); + // } + // } } } return authToken != null; From 42cb4774b5a653a9b881d502587fbef6264c543b Mon Sep 17 00:00:00 2001 From: ivan2282 Date: Sun, 30 Nov 2025 21:53:45 +0300 Subject: [PATCH 3/4] Sferum button hide option --- lib/screens/chats_screen.dart | 16 ++++++++++++++-- lib/screens/settings/komet_misc_screen.dart | 21 +++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/lib/screens/chats_screen.dart b/lib/screens/chats_screen.dart index e0b18fd..bfe854a 100644 --- a/lib/screens/chats_screen.dart +++ b/lib/screens/chats_screen.dart @@ -99,9 +99,16 @@ class _ChatsScreenState extends State StreamSubscription? _connectionStateSubscription; bool _isAccountsExpanded = false; + late SharedPreferences prefs; + + Future _initializePrefs() async { + prefs = await SharedPreferences.getInstance(); + } + @override void initState() { super.initState(); + _initializePrefs(); _loadMyProfile(); _chatsFuture = (() async { try { @@ -118,6 +125,9 @@ class _ChatsScreenState extends State rethrow; } })(); + + + _listenForUpdates(); _searchAnimationController = AnimationController( @@ -155,6 +165,7 @@ class _ChatsScreenState extends State _loadChannels(); } }); + final prefs = SharedPreferences.getInstance(); } @override @@ -3582,7 +3593,8 @@ class _ChatsScreenState extends State ), ] : [ - IconButton( + if (prefs.getBool('show_sferum_button') ?? true) + IconButton( icon: Image.asset( 'assets/images/spermum.png', width: 28, @@ -4508,7 +4520,7 @@ class _SferumWebViewPanelState extends State { color: colors.surface, child: const Center( child: Text( - 'Сферум временно не доступен на линуксе,\nмы думаем как это исправить.', + 'Веб приложения временно не доступны на линуксе,\nмы думаем как это исправить.', textAlign: TextAlign.center, style: TextStyle(fontSize: 18, fontWeight: FontWeight.w600), ), diff --git a/lib/screens/settings/komet_misc_screen.dart b/lib/screens/settings/komet_misc_screen.dart index ab0310d..3ed0a96 100644 --- a/lib/screens/settings/komet_misc_screen.dart +++ b/lib/screens/settings/komet_misc_screen.dart @@ -18,6 +18,7 @@ class _KometMiscScreenState extends State { bool _showUpdateNotification = true; bool _enableWebVersionCheck = false; bool _showSpoofUpdateDialog = true; + bool _showSferumButton = true; @override void initState() { @@ -36,6 +37,8 @@ class _KometMiscScreenState extends State { prefs.getBool('enable_web_version_check') ?? false; _showSpoofUpdateDialog = prefs.getBool('show_spoof_update_dialog') ?? true; + _showSferumButton = + prefs.getBool('show_sferum_button') ?? true; }); } @@ -225,6 +228,24 @@ class _KometMiscScreenState extends State { _updateSettings('show_spoof_update_dialog', value); }, ), + const Divider(height: 1), + SwitchListTile( + secondary: Icon( + Icons.remove_red_eye, + color: Theme.of(context).colorScheme.primary, + ), + title: const Text("Показывать кнопку Сферум?"), + subtitle: const Text( + "Показывать кнопку Сферум в главном меню. Для применения нужен перезапуск приложения.", + ), + value: _showSferumButton, + onChanged: (bool value) { + setState(() { + _showSferumButton = value; + }); + _updateSettings('show_sferum_button', value); + }, + ), ], ), ), From 58e18b06a8af5a3a31ab7ae61002c28052f26983 Mon Sep 17 00:00:00 2001 From: ivan2282 Date: Sun, 30 Nov 2025 22:48:41 +0300 Subject: [PATCH 4/4] Colored text --- lib/widgets/chat_message_bubble.dart | 39 +++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/lib/widgets/chat_message_bubble.dart b/lib/widgets/chat_message_bubble.dart index dbd68e2..a641665 100644 --- a/lib/widgets/chat_message_bubble.dart +++ b/lib/widgets/chat_message_bubble.dart @@ -3752,13 +3752,38 @@ class ChatMessageBubble extends StatelessWidget { ], if (message.text.isNotEmpty) ...[ if (message.text.contains("welcome.saved.dialog.message")) - Container( - alignment: Alignment.center, - child: Text( - 'Привет! Это твои избранные. Все написанное сюда попадёт прямиком к дяде Майору.', - style: TextStyle(color: textColor, fontStyle: FontStyle.italic), - textAlign: TextAlign.center, - ), + Linkify( + text:'Привет! Это твои избранные. Все написанное сюда попадёт прямиком к дяде Майору.', + style: TextStyle(color: textColor, fontStyle: FontStyle.italic), + linkStyle: linkStyle, + onOpen: onOpenLink, + options: const LinkifyOptions(humanize: false), + textAlign: TextAlign.left, + ) + else if (message.text.contains("komet.custom_text")) + Linkify( + style: message.text.contains("komet.custom_text.red") ? + TextStyle(color: Color.from(alpha: 255, red: 255, green: 0, blue: 0)) : + message.text.contains("komet.custom_text.black") ? + TextStyle(color: Color.from(alpha: 255, red: 0, green: 0, blue: 0)) : + message.text.contains("komet.custom_text.green") ? + TextStyle(color: Color.from(alpha: 255, red: 0, green: 255, blue: 0)) : + message.text.contains("komet.custom_text.white") ? + TextStyle(color: Color.from(alpha: 255, red: 255, green: 255, blue: 255)) : defaultTextStyle, + linkStyle: linkStyle, + onOpen: onOpenLink, + options: const LinkifyOptions(humanize: false), + textAlign: message.text.contains("komet.custom_text.right") + ? TextAlign.right + : message.text.contains("komet.custom_text.center") ? TextAlign.center : TextAlign.left, + text: message.text + .replaceAll("komet.custom_text.red", "") + .replaceAll("komet.custom_text.black", "") + .replaceAll("komet.custom_text.green", "") + .replaceAll("komet.custom_text.white", "") + .replaceAll("komet.custom_text.right", "") + .replaceAll("komet.custom_text.center", "") + .replaceAll("komet.custom_text", ""), ) else Linkify(