1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-12-24 11:58:51 +00:00

Can open conversation in full screen

This commit is contained in:
Pierre HUBERT 2020-05-11 18:27:00 +02:00
parent a01ebe7d8a
commit f3eda1c89d

View File

@ -17,7 +17,7 @@ import 'package:flutter/material.dart';
///
/// @author Pierre Hubert
enum _Actions { OPEN_MEMBERS, OPEN_SETTINGS }
enum _Actions { OPEN_FULL_SCREEN, OPEN_MEMBERS, OPEN_SETTINGS }
class ConversationWindow extends StatefulWidget {
final int convID;
@ -131,7 +131,11 @@ class _ConversationWindowState extends SafeState<ConversationWindow> {
..addAll(<Widget>[
PopupMenuButton<_Actions>(
itemBuilder: (c) => [
// Start a new call
// Show in full screen
PopupMenuItem(
child: Text(tr("Open in full screen")),
value: _Actions.OPEN_FULL_SCREEN,
),
// Show the list of members
PopupMenuItem(
@ -157,6 +161,10 @@ class _ConversationWindowState extends SafeState<ConversationWindow> {
void _menuCallback(_Actions value) {
switch (value) {
case _Actions.OPEN_FULL_SCREEN:
_openFullScreen();
break;
case _Actions.OPEN_MEMBERS:
_openMembersList();
break;
@ -167,6 +175,11 @@ class _ConversationWindowState extends SafeState<ConversationWindow> {
}
}
void _openFullScreen() {
MainController.of(context).openConversation(_convID, fullScreen: true);
widget.onClose();
}
void _openMembersList() {
showScreenDialog(context, ConversationMembersScreen(convID: _convID));
}