1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-12-25 12:28:50 +00:00

Can open conversation from unread conversations dropdown

This commit is contained in:
Pierre HUBERT 2020-05-09 14:56:33 +02:00
parent c262e40e81
commit 4db9191fd8
3 changed files with 7 additions and 0 deletions

View File

@ -22,6 +22,10 @@ abstract class MainController extends State<MainRoute> {
return mainControllerKey.currentState;
}
/// Pop until main route is reached
void popUntilMainRoute() => Navigator.of(context).popUntil((settings) =>
ModalRoute.of(context).isCurrent || !ModalRoute.of(context).isActive);
/// Open user page
void openUserPage(int userID);

View File

@ -66,6 +66,7 @@ class _TabletRouteState extends MainController {
@override
void openConversation(int convID, {fullScreen = false}) {
popUntilMainRoute();
_conversationsKey.currentState.openConversations(convID);
}

View File

@ -3,6 +3,7 @@ import 'package:comunic/helpers/events_helper.dart';
import 'package:comunic/helpers/users_helper.dart';
import 'package:comunic/lists/unread_conversations_list.dart';
import 'package:comunic/lists/users_list.dart';
import 'package:comunic/ui/routes/main_route/main_route.dart';
import 'package:comunic/ui/widgets/account_image_widget.dart';
import 'package:comunic/ui/widgets/async_screen_widget.dart';
import 'package:comunic/ui/widgets/safe_state.dart';
@ -84,6 +85,7 @@ class _UnreadConversationsScreenState
]),
),
trailing: Text(diffTimeFromNowToStr(conv.lastActive)),
onTap: () => MainController.of(context).openConversation(conv.id),
);
}
}