From aa74769f2e7fc6bb241fdb6ddfc94d3cacedf1a2 Mon Sep 17 00:00:00 2001 From: MadKris Date: Thu, 20 Nov 2025 13:14:38 +0300 Subject: [PATCH 1/5] not finished --- lib/ui/views/main_page/chat/chat.dart | 225 +++++++++++++++++++------- 1 file changed, 163 insertions(+), 62 deletions(-) diff --git a/lib/ui/views/main_page/chat/chat.dart b/lib/ui/views/main_page/chat/chat.dart index 046a2a1e..6f0a9b79 100644 --- a/lib/ui/views/main_page/chat/chat.dart +++ b/lib/ui/views/main_page/chat/chat.dart @@ -10,6 +10,7 @@ import 'package:unn_mobile/core/constants/date_pattern.dart'; import 'package:unn_mobile/core/misc/date_time_utilities/date_time_extensions.dart'; import 'package:unn_mobile/core/misc/user/user_functions.dart'; import 'package:unn_mobile/core/models/dialog/dialog.dart' as d; +import 'package:unn_mobile/core/services/interfaces/dialog/dialog_search_service.dart'; import 'package:unn_mobile/core/viewmodels/factories/main_page_routes_view_models_factory.dart'; import 'package:unn_mobile/core/viewmodels/main_page/chat/chat_screen_view_model.dart'; import 'package:unn_mobile/ui/views/base_view.dart'; @@ -26,6 +27,30 @@ class ChatScreenView extends StatefulWidget { } class _ChatScreenViewState extends State { + ValueNotifier selectedItem = ValueNotifier(null); + + @override + void initState() { + super.initState(); + selectedItem.addListener( + () { + if (selectedItem.value == null) { + return; + } + final val = selectedItem.value; + selectedItem.value = null; + WidgetsBinding.instance.addPostFrameCallback((_) async { + await Future.delayed(const Duration(milliseconds: 1000)); + if (mounted) { + GoRouter.of(context).go( + '${GoRouter.of(context).state.path}/$val', + ); + } + }); + }, + ); + } + @override Widget build(BuildContext context) { final viewModel = widget.bottomRouteIndex == null @@ -35,73 +60,149 @@ class _ChatScreenViewState extends State { .getViewModelByRouteIndex( widget.bottomRouteIndex!, ); - + final theme = Theme.of(context); return BaseView( - builder: (context, model, child) => Scaffold( - appBar: AppBar( - title: const Text('Сообщения'), - leading: getSubpageLeading(widget.bottomRouteIndex), - ), - body: Builder( - builder: (context) { - if (model.isBusy && model.dialogs.isEmpty) { - return const Center( - child: SizedBox( - width: 40, - height: 40, - child: CircularProgressIndicator(), - ), - ); - } - if (model.hasError && model.dialogs.isEmpty) { - return Center( - child: Column( - children: [ - const Text('Не удалось загрузить'), - TextButton( - onPressed: () { - model.init(); - }, - child: const Text('Повторить загрузку'), - ), - ], + builder: (context, model, child) { + final pageContext = context; + return Scaffold( + appBar: AppBar( + title: const Text('Сообщения'), + leading: getSubpageLeading(widget.bottomRouteIndex), + actions: [ + if (!model.isBusy) + SearchAnchor( + builder: (context, controller) => IconButton( + onPressed: () { + controller.openView(); + }, + icon: const Icon(Icons.search), + ), + suggestionsBuilder: (context, controller) async { + final suggService = + Injector.appInstance.get(); + if (controller.text.length < 3) { + final history = await suggService.getHistory(); + return history + ?.where((e) => e.title.contains(controller.text)) + .map( + (e) => ListTile( + title: Text(e.title), + ), + ) ?? + []; + } + final sugg = await suggService.search(controller.text); + final data = sugg + ?.map( + (e) => ListTile( + leading: CircleAvatar( + radius: MediaQuery.of(context) + .textScaler + .scale(26.0), + foregroundImage: e.avatarUrl.isNotEmpty + ? CachedNetworkImageProvider(e.avatarUrl) + : null, + child: e.avatarUrl.isEmpty + ? FittedBox( + fit: BoxFit.cover, + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Text( + generateInitials( + e.title.split(' ')), + style: theme + .textTheme.headlineSmall! + .copyWith( + color: + theme.colorScheme.onSurface, + ), + ), + ), + ) + : null, + ), + title: Text( + e.title, + overflow: TextOverflow.ellipsis, + style: theme.textTheme.titleMedium, + ), + enableFeedback: true, + visualDensity: + VisualDensity.adaptivePlatformDensity, + onTap: () { + controller.closeView(''); + selectedItem.value = e.chatId; + }, + ), + ) + .toList() ?? + []; + return data; + }, ), - ); - } - return NotificationListener( - onNotification: (e) { - if (e.metrics.maxScrollExtent - e.metrics.pixels < 20.0 && - model.hasMoreDialogs) { - model.loadMore(); - } - return true; - }, - child: RefreshIndicator( - onRefresh: () async => await model.init(), - child: ListView( - physics: const AlwaysScrollableScrollPhysics(), - children: [ - for (final (dialog) in model.dialogs) - DialogInfo( - dialog: dialog, - chatsModel: model, + ], + ), + body: Builder( + builder: (context) { + if (model.isBusy && model.dialogs.isEmpty) { + return const Center( + child: SizedBox( + width: 40, + height: 40, + child: CircularProgressIndicator(), + ), + ); + } + if (model.hasError && model.dialogs.isEmpty) { + return Center( + child: Column( + children: [ + const Text('Не удалось загрузить'), + TextButton( + onPressed: () { + model.init(); + }, + child: const Text('Повторить загрузку'), ), - if (model.hasError) const Text('Не удалось загрузить'), - if (model.isBusy) - const Center( - child: SizedBox( - width: 20, - height: 20, - child: CircularProgressIndicator(), + ], + ), + ); + } + return NotificationListener( + onNotification: (e) { + if (e.metrics.maxScrollExtent - e.metrics.pixels < 20.0 && + model.hasMoreDialogs) { + model.loadMore(); + } + return true; + }, + child: RefreshIndicator( + onRefresh: () async => await model.init(), + child: ListView( + physics: const AlwaysScrollableScrollPhysics(), + children: [ + for (final (dialog) in model.dialogs) + DialogInfo( + dialog: dialog, + chatsModel: model, ), - ), - ], + if (model.hasError) const Text('Не удалось загрузить'), + if (model.isBusy) + const Center( + child: SizedBox( + width: 20, + height: 20, + child: CircularProgressIndicator(), + ), + ), + ], + ), ), - ), - ); - }, - ), - ), + ); + }, + ), + ); + }, model: viewModel, onModelReady: (model) => model.init(), ); From 2fc34e1b786784cf0f75fb8f0c26877ce3acbac2 Mon Sep 17 00:00:00 2001 From: MadKris Date: Sat, 22 Nov 2025 22:36:34 +0300 Subject: [PATCH 2/5] =?UTF-8?q?=D0=9F=D0=BE=D1=87=D1=82=D0=B8=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D0=B5=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chat/chat_inside_view_model.dart | 27 +- .../chat/chat_screen_view_model.dart | 3 + lib/ui/views/main_page/chat/chat.dart | 300 ++++++++---------- lib/ui/views/main_page/chat/chat_inside.dart | 5 +- 4 files changed, 166 insertions(+), 169 deletions(-) diff --git a/lib/core/viewmodels/main_page/chat/chat_inside_view_model.dart b/lib/core/viewmodels/main_page/chat/chat_inside_view_model.dart index a930d7f5..2261740b 100644 --- a/lib/core/viewmodels/main_page/chat/chat_inside_view_model.dart +++ b/lib/core/viewmodels/main_page/chat/chat_inside_view_model.dart @@ -11,10 +11,13 @@ import 'package:unn_mobile/core/misc/date_time_utilities/date_time_extensions.da import 'package:unn_mobile/core/misc/objects_with_pagination.dart'; import 'package:unn_mobile/core/misc/user/current_user_sync_storage.dart'; import 'package:unn_mobile/core/models/common/file_data.dart'; +import 'package:unn_mobile/core/models/dialog/base_dialog_info.dart'; import 'package:unn_mobile/core/models/dialog/dialog.dart'; import 'package:unn_mobile/core/models/dialog/group_dialog.dart'; import 'package:unn_mobile/core/models/dialog/message/enum/message_state.dart'; import 'package:unn_mobile/core/models/dialog/message/message.dart'; +import 'package:unn_mobile/core/models/dialog/preview_group_dialog.dart'; +import 'package:unn_mobile/core/models/dialog/preview_user_dialog.dart'; import 'package:unn_mobile/core/models/dialog/user_dialog.dart'; import 'package:unn_mobile/core/viewmodels/base_view_model.dart'; import 'package:unn_mobile/core/viewmodels/factories/main_page_routes_view_models_factory.dart'; @@ -27,7 +30,7 @@ class ChatInsideViewModel extends BaseViewModel { ChatScreenViewModel? _dialogsViewModel; - Dialog? _dialog; + BaseDialogInfo? _dialog; bool _hasError = false; @@ -57,7 +60,10 @@ class ChatInsideViewModel extends BaseViewModel { ); int? get currentUserId => _currentUserSyncStorage.currentUserData?.bitrixId; - Dialog? get dialog => _dialog; + int get unreadMessagesCount => + (_dialog is Dialog) ? (_dialog! as Dialog).unreadMessagesCount : 0; + + BaseDialogInfo? get dialog => _dialog; bool get hasError => _hasError; bool get hasMessagesAfter => _hasMessagesAfter; @@ -99,8 +105,7 @@ class ChatInsideViewModel extends BaseViewModel { if (refreshLoopRunning && !refreshLoopStopFlag) { await _dialogsViewModel!.init(); - _dialog = _dialogsViewModel!.dialogs - .firstWhere((d) => d.chatId == _dialog!.chatId); + fetchDialogFromRoot(_dialog!.chatId); _dialogsViewModel!.notifyListeners(); } @@ -116,6 +121,13 @@ class ChatInsideViewModel extends BaseViewModel { ..addAll(_partitionMessages(_unpartitionedMessages)); } + void fetchDialogFromRoot(int chatId) { + _dialog = _dialogsViewModel!.dialogs.cast().firstWhere( + (d) => d.chatId == chatId, + orElse: () => _dialogsViewModel!.storedDialogInfo!, + ); + } + FutureOr init(int chatId) async { _isInitializing = true; try { @@ -169,7 +181,6 @@ class ChatInsideViewModel extends BaseViewModel { await Future.delayed(const Duration(seconds: 5)); if (!_isInitializing) { await getNewMessages(); - notifyListeners(); } await refreshLoop(checkStartConditions: false); @@ -187,6 +198,8 @@ class ChatInsideViewModel extends BaseViewModel { FutureOr sendMessage(String text) async => await _sendMessageWrapper(() async { final dialogId = switch (_dialog) { + final PreviewGroupDialog groupDialog => groupDialog.id, + final PreviewUserDialog userDialog => userDialog.chatId.toString(), final UserDialog userDialog => userDialog.dialogId.toString(), final GroupDialog groupDialog => groupDialog.dialogId, _ => '', @@ -211,8 +224,7 @@ class ChatInsideViewModel extends BaseViewModel { _unpartitionedMessages.clear(); _dialogsViewModel = _routesViewModelFactory.getViewModelByType(); - _dialog = _dialogsViewModel!.dialogs.firstWhere((d) => d.chatId == chatId); - + fetchDialogFromRoot(chatId); final messages = await tryLoginAndRetrieveData>( () => _messagesAggregator.fetch(chatId: chatId), () => null, @@ -233,7 +245,6 @@ class ChatInsideViewModel extends BaseViewModel { List>> _partitionMessages(Iterable messages) { const maxTimeDifference = 5; - final unreadMessagesCount = _dialog?.unreadMessagesCount ?? 0; final List>> partitions = []; for (final (index, message) in messages.indexed) { final lastDatePartition = partitions.lastOrNull; diff --git a/lib/core/viewmodels/main_page/chat/chat_screen_view_model.dart b/lib/core/viewmodels/main_page/chat/chat_screen_view_model.dart index 5c7aeaf9..ed7e7856 100644 --- a/lib/core/viewmodels/main_page/chat/chat_screen_view_model.dart +++ b/lib/core/viewmodels/main_page/chat/chat_screen_view_model.dart @@ -6,6 +6,7 @@ import 'dart:async'; import 'package:unn_mobile/core/misc/authorisation/try_login_and_retrieve_data.dart'; import 'package:unn_mobile/core/misc/objects_with_pagination.dart'; import 'package:unn_mobile/core/misc/user/current_user_sync_storage.dart'; +import 'package:unn_mobile/core/models/dialog/base_dialog_info.dart'; import 'package:unn_mobile/core/models/dialog/dialog.dart'; import 'package:unn_mobile/core/models/dialog/dialog_query_parameter.dart'; import 'package:unn_mobile/core/services/interfaces/dialog/dialog_service.dart'; @@ -21,6 +22,8 @@ class ChatScreenViewModel extends BaseViewModel { final List _dialogs = []; + BaseDialogInfo? storedDialogInfo; + int? _currentUserId; bool _hasError = false; diff --git a/lib/ui/views/main_page/chat/chat.dart b/lib/ui/views/main_page/chat/chat.dart index 6f0a9b79..61978046 100644 --- a/lib/ui/views/main_page/chat/chat.dart +++ b/lib/ui/views/main_page/chat/chat.dart @@ -10,6 +10,7 @@ import 'package:unn_mobile/core/constants/date_pattern.dart'; import 'package:unn_mobile/core/misc/date_time_utilities/date_time_extensions.dart'; import 'package:unn_mobile/core/misc/user/user_functions.dart'; import 'package:unn_mobile/core/models/dialog/dialog.dart' as d; +import 'package:unn_mobile/core/models/dialog/preview_dialog.dart'; import 'package:unn_mobile/core/services/interfaces/dialog/dialog_search_service.dart'; import 'package:unn_mobile/core/viewmodels/factories/main_page_routes_view_models_factory.dart'; import 'package:unn_mobile/core/viewmodels/main_page/chat/chat_screen_view_model.dart'; @@ -27,30 +28,6 @@ class ChatScreenView extends StatefulWidget { } class _ChatScreenViewState extends State { - ValueNotifier selectedItem = ValueNotifier(null); - - @override - void initState() { - super.initState(); - selectedItem.addListener( - () { - if (selectedItem.value == null) { - return; - } - final val = selectedItem.value; - selectedItem.value = null; - WidgetsBinding.instance.addPostFrameCallback((_) async { - await Future.delayed(const Duration(milliseconds: 1000)); - if (mounted) { - GoRouter.of(context).go( - '${GoRouter.of(context).state.path}/$val', - ); - } - }); - }, - ); - } - @override Widget build(BuildContext context) { final viewModel = widget.bottomRouteIndex == null @@ -60,151 +37,156 @@ class _ChatScreenViewState extends State { .getViewModelByRouteIndex( widget.bottomRouteIndex!, ); - final theme = Theme.of(context); return BaseView( - builder: (context, model, child) { - final pageContext = context; - return Scaffold( - appBar: AppBar( - title: const Text('Сообщения'), - leading: getSubpageLeading(widget.bottomRouteIndex), - actions: [ - if (!model.isBusy) - SearchAnchor( - builder: (context, controller) => IconButton( - onPressed: () { - controller.openView(); - }, - icon: const Icon(Icons.search), - ), - suggestionsBuilder: (context, controller) async { - final suggService = - Injector.appInstance.get(); - if (controller.text.length < 3) { - final history = await suggService.getHistory(); - return history - ?.where((e) => e.title.contains(controller.text)) - .map( - (e) => ListTile( - title: Text(e.title), - ), - ) ?? - []; - } - final sugg = await suggService.search(controller.text); - final data = sugg - ?.map( - (e) => ListTile( - leading: CircleAvatar( - radius: MediaQuery.of(context) - .textScaler - .scale(26.0), - foregroundImage: e.avatarUrl.isNotEmpty - ? CachedNetworkImageProvider(e.avatarUrl) - : null, - child: e.avatarUrl.isEmpty - ? FittedBox( - fit: BoxFit.cover, - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Text( - generateInitials( - e.title.split(' ')), - style: theme - .textTheme.headlineSmall! - .copyWith( - color: - theme.colorScheme.onSurface, - ), - ), - ), - ) - : null, - ), - title: Text( - e.title, - overflow: TextOverflow.ellipsis, - style: theme.textTheme.titleMedium, - ), - enableFeedback: true, - visualDensity: - VisualDensity.adaptivePlatformDensity, - onTap: () { - controller.closeView(''); - selectedItem.value = e.chatId; - }, - ), - ) - .toList() ?? - []; - return data; + builder: (context, model, child) => Scaffold( + appBar: AppBar( + title: const Text('Сообщения'), + leading: getSubpageLeading(widget.bottomRouteIndex), + actions: [ + if (!model.isBusy) + SearchAnchor( + builder: (context, controller) => IconButton( + onPressed: () { + controller.openView(); }, + icon: const Icon(Icons.search), ), - ], - ), - body: Builder( - builder: (context) { - if (model.isBusy && model.dialogs.isEmpty) { - return const Center( - child: SizedBox( - width: 40, - height: 40, - child: CircularProgressIndicator(), - ), - ); - } - if (model.hasError && model.dialogs.isEmpty) { - return Center( - child: Column( - children: [ - const Text('Не удалось загрузить'), - TextButton( - onPressed: () { - model.init(); - }, - child: const Text('Повторить загрузку'), - ), - ], - ), - ); - } - return NotificationListener( - onNotification: (e) { - if (e.metrics.maxScrollExtent - e.metrics.pixels < 20.0 && - model.hasMoreDialogs) { - model.loadMore(); + suggestionsBuilder: (context, controller) async { + final suggService = + Injector.appInstance.get(); + if (controller.text.length < 3) { + final history = await suggService.getHistory(); + return history + ?.where((e) => e.title.contains(controller.text)) + .map( + (e) => + searchItemTile(context, e, controller, model), + ) ?? + []; } - return true; + final sugg = await suggService.search(controller.text); + final data = sugg + ?.map( + (e) => + searchItemTile(context, e, controller, model), + ) + .toList() ?? + []; + return data; }, - child: RefreshIndicator( - onRefresh: () async => await model.init(), - child: ListView( - physics: const AlwaysScrollableScrollPhysics(), - children: [ - for (final (dialog) in model.dialogs) - DialogInfo( - dialog: dialog, - chatsModel: model, - ), - if (model.hasError) const Text('Не удалось загрузить'), - if (model.isBusy) - const Center( - child: SizedBox( - width: 20, - height: 20, - child: CircularProgressIndicator(), - ), + ), + ], + ), + body: Builder( + builder: (context) { + if (model.isBusy && model.dialogs.isEmpty) { + return const Center( + child: SizedBox( + width: 40, + height: 40, + child: CircularProgressIndicator(), + ), + ); + } + if (model.hasError && model.dialogs.isEmpty) { + return Center( + child: Column( + children: [ + const Text('Не удалось загрузить'), + TextButton( + onPressed: () { + model.init(); + }, + child: const Text('Повторить загрузку'), + ), + ], + ), + ); + } + return NotificationListener( + onNotification: (e) { + if (e.metrics.maxScrollExtent - e.metrics.pixels < 20.0 && + model.hasMoreDialogs) { + model.loadMore(); + } + return true; + }, + child: RefreshIndicator( + onRefresh: () async => await model.init(), + child: ListView( + physics: const AlwaysScrollableScrollPhysics(), + children: [ + for (final (dialog) in model.dialogs) + DialogInfo( + dialog: dialog, + chatsModel: model, + ), + if (model.hasError) const Text('Не удалось загрузить'), + if (model.isBusy) + const Center( + child: SizedBox( + width: 20, + height: 20, + child: CircularProgressIndicator(), ), - ], + ), + ], + ), + ), + ); + }, + ), + ), + model: viewModel, + onModelReady: (model) => model.init(), + ); + } + + Widget searchItemTile( + BuildContext context, + PreviewDialog dialog, + SearchController controller, + ChatScreenViewModel model, + ) { + final theme = Theme.of(context); + + return ListTile( + leading: CircleAvatar( + radius: MediaQuery.of(context).textScaler.scale(26.0), + foregroundImage: dialog.avatarUrl.isNotEmpty + ? CachedNetworkImageProvider(dialog.avatarUrl) + : null, + child: dialog.avatarUrl.isEmpty + ? FittedBox( + fit: BoxFit.cover, + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Text( + generateInitials( + dialog.title.split(' '), + ), + style: theme.textTheme.headlineSmall!.copyWith( + color: theme.colorScheme.onSurface, + ), ), ), - ); - }, - ), + ) + : null, + ), + title: Text( + dialog.title, + overflow: TextOverflow.ellipsis, + style: theme.textTheme.titleMedium, + ), + enableFeedback: true, + visualDensity: VisualDensity.adaptivePlatformDensity, + onTap: () { + controller.closeView(''); + model.storedDialogInfo = dialog; + GoRouter.of(context).go( + '${GoRouter.of(context).state.path}/${dialog.chatId}', ); }, - model: viewModel, - onModelReady: (model) => model.init(), ); } } diff --git a/lib/ui/views/main_page/chat/chat_inside.dart b/lib/ui/views/main_page/chat/chat_inside.dart index be0e6a52..f4887141 100644 --- a/lib/ui/views/main_page/chat/chat_inside.dart +++ b/lib/ui/views/main_page/chat/chat_inside.dart @@ -31,7 +31,7 @@ class _ChatInsideState extends State { WidgetsBinding.instance.addPostFrameCallback((_) { if (!hasScrolledOnce && model.dialog != null && - model.dialog!.unreadMessagesCount > 0 && + model.unreadMessagesCount > 0 && scrollController.hasClients) { final renderBox = newMessagesKey.currentContext ?.findRenderObject() as RenderBox?; @@ -142,7 +142,8 @@ class _ChatInsideState extends State { ), ), ], - if (model.lastReadMessageId == null) + if (model.messages.isNotEmpty && + model.lastReadMessageId == null) _buildNewMessagesBar(), if (model.isBusy) const Center( From 12a1543a3e0566eea73061ecacf50cf18cdbe07d Mon Sep 17 00:00:00 2001 From: UNN MOBILE runner Date: Thu, 27 Nov 2025 10:48:55 +0000 Subject: [PATCH 3/5] Change version in pubspec --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 5ab34b9a..847790b9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: unn_mobile description: A mobile application for UNN Portal website publish_to: 'none' -version: 0.6.0+371 +version: 0.6.0+373 environment: sdk: '>=3.1.2 <4.0.0' From dcce8e9d6c20cbdad0fe9a11a21d944200b4f416 Mon Sep 17 00:00:00 2001 From: UNN MOBILE runner Date: Sun, 30 Nov 2025 15:51:52 +0000 Subject: [PATCH 4/5] Change version in pubspec --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 126406a6..5f8ee076 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: unn_mobile description: A mobile application for UNN Portal website publish_to: 'none' -version: 0.6.0+375 +version: 0.6.0+376 environment: sdk: '>=3.1.2 <4.0.0' From 038339dcdfd60d59cff6dc95e37e0e7c7d82248d Mon Sep 17 00:00:00 2001 From: MadKris Date: Sun, 30 Nov 2025 19:01:10 +0300 Subject: [PATCH 5/5] =?UTF-8?q?=D0=9F=D0=BE=D0=BC=D0=B5=D0=BD=D1=8F=D0=BB?= =?UTF-8?q?=20=D0=BF=D0=BE=D1=80=D1=8F=D0=B4=D0=BE=D0=BA=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=B4=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=20=D0=B2=20?= =?UTF-8?q?=D1=87=D0=B0=D1=82=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/ui/views/main_page/main_page_routing.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/ui/views/main_page/main_page_routing.dart b/lib/ui/views/main_page/main_page_routing.dart index d3a694e3..e0e2e98b 100644 --- a/lib/ui/views/main_page/main_page_routing.dart +++ b/lib/ui/views/main_page/main_page_routing.dart @@ -136,18 +136,18 @@ class MainPageRouting { Icons.chat, Icons.chat, 'Чат', - ':chatId', - builder: (_, state) => ChatInside( - chatId: int.tryParse(state.pathParameters['chatId'] ?? '0') ?? 0, - ), + 'stored', + builder: (_, state) => const ChatInside(), userTypes: [], ), MainPageRouteData( Icons.chat, Icons.chat, 'Чат', - 'stored', - builder: (_, state) => const ChatInside(), + ':chatId', + builder: (_, state) => ChatInside( + chatId: int.tryParse(state.pathParameters['chatId'] ?? '0') ?? 0, + ), userTypes: [], ), ],