1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-22 12:59:21 +00:00

Can change conversation settings

This commit is contained in:
Pierre HUBERT 2020-05-09 14:21:02 +02:00
parent b23aa782b8
commit 27176531cf

View File

@ -2,6 +2,7 @@ import 'package:comunic/helpers/conversations_helper.dart';
import 'package:comunic/helpers/events_helper.dart'; import 'package:comunic/helpers/events_helper.dart';
import 'package:comunic/models/conversation.dart'; import 'package:comunic/models/conversation.dart';
import 'package:comunic/ui/dialogs/screen_dialog.dart'; import 'package:comunic/ui/dialogs/screen_dialog.dart';
import 'package:comunic/ui/routes/update_conversation_route.dart';
import 'package:comunic/ui/screens/conversation_members_screen.dart'; import 'package:comunic/ui/screens/conversation_members_screen.dart';
import 'package:comunic/ui/screens/conversation_screen.dart'; import 'package:comunic/ui/screens/conversation_screen.dart';
import 'package:comunic/ui/widgets/safe_state.dart'; import 'package:comunic/ui/widgets/safe_state.dart';
@ -15,7 +16,7 @@ import 'package:flutter/material.dart';
/// ///
/// @author Pierre Hubert /// @author Pierre Hubert
enum _Actions { OPEN_MEMBERS } enum _Actions { OPEN_MEMBERS, OPEN_SETTINGS }
class ConversationWindow extends StatefulWidget { class ConversationWindow extends StatefulWidget {
final int convID; final int convID;
@ -130,6 +131,12 @@ class _ConversationWindowState extends SafeState<ConversationWindow> {
PopupMenuItem( PopupMenuItem(
child: Text(tr("Members")), child: Text(tr("Members")),
value: _Actions.OPEN_MEMBERS, value: _Actions.OPEN_MEMBERS,
),
// Show conversation settings
PopupMenuItem(
child: Text(tr("Settings")),
value: _Actions.OPEN_SETTINGS,
) )
], ],
onSelected: _menuCallback, onSelected: _menuCallback,
@ -147,10 +154,20 @@ class _ConversationWindowState extends SafeState<ConversationWindow> {
case _Actions.OPEN_MEMBERS: case _Actions.OPEN_MEMBERS:
_openMembersList(); _openMembersList();
break; break;
case _Actions.OPEN_SETTINGS:
_openConversationSettings();
break;
} }
} }
void _openMembersList() { void _openMembersList() {
showScreenDialog(context, ConversationMembersScreen(convID: _convID)); showScreenDialog(context, ConversationMembersScreen(convID: _convID));
} }
void _openConversationSettings() async {
await showScreenDialog(
context, UpdateConversationRoute(conversationID: _convID));
_refresh();
}
} }