diff --git a/lib/ui/routes/main_route/main_route.dart b/lib/ui/routes/main_route/main_route.dart index cfdbdd5..c5bc642 100644 --- a/lib/ui/routes/main_route/main_route.dart +++ b/lib/ui/routes/main_route/main_route.dart @@ -32,8 +32,8 @@ mixin MainController implements State { void push(Widget w, {bool hideNavBar}); /// Open a conversation - void openConversation(int convID); + void openConversation(int convID, {fullScreen: false}); /// Start a call for a given conversation void startCall(int convID); -} \ No newline at end of file +} diff --git a/lib/ui/routes/main_route/smartphone_route.dart b/lib/ui/routes/main_route/smartphone_route.dart index 01ddfa8..4843195 100644 --- a/lib/ui/routes/main_route/smartphone_route.dart +++ b/lib/ui/routes/main_route/smartphone_route.dart @@ -52,8 +52,6 @@ class CurrPage { "\n}"; } - - /// Private implementation of HomeController class _MainRouteState extends State implements MainController { CurrPage get _currTab => history.last; @@ -252,7 +250,7 @@ class _MainRouteState extends State implements MainController { } @override - void openConversation(int convID) { + void openConversation(int convID, {fullScreen: false}) { _pushPage(CurrPage( BarCallbackActions.OPEN_CONVERSATION, args: {"convID": convID}, diff --git a/lib/ui/screens/conversations_list_screen.dart b/lib/ui/screens/conversations_list_screen.dart index 57fda64..4fb812d 100644 --- a/lib/ui/screens/conversations_list_screen.dart +++ b/lib/ui/screens/conversations_list_screen.dart @@ -19,9 +19,13 @@ import 'package:flutter/material.dart'; class ConversationsListScreen extends StatefulWidget { final bool useSmallFAB; + final Function() onOpen; - const ConversationsListScreen({Key key, this.useSmallFAB = false}) - : assert(useSmallFAB != null), + const ConversationsListScreen({ + Key key, + this.useSmallFAB = false, + this.onOpen, + }) : assert(useSmallFAB != null), super(key: key); @override @@ -107,6 +111,7 @@ class _ConversationScreenState extends SafeState { /// Open a conversation void _openConversation(int conversationId) { MainController.of(context).openConversation(conversationId); + if (widget.onOpen != null) widget.onOpen(); } /// Create a new conversation diff --git a/lib/ui/widgets/tablet_mode/conversations/open_conversation_button_widget.dart b/lib/ui/widgets/tablet_mode/conversations/open_conversation_button_widget.dart index bed360b..3aad55a 100644 --- a/lib/ui/widgets/tablet_mode/conversations/open_conversation_button_widget.dart +++ b/lib/ui/widgets/tablet_mode/conversations/open_conversation_button_widget.dart @@ -38,6 +38,9 @@ class _OpenConversationButtonState extends State { width: 300, height: 500, child: Card( - child: ConversationsListScreen(useSmallFAB: true), + child: ConversationsListScreen( + useSmallFAB: true, + onOpen: () => _setShowConversationsList(false), + ), )); }