mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-04 04:04:18 +00:00 
			
		
		
		
	Ready to implement call system
This commit is contained in:
		@@ -2,6 +2,7 @@ import 'package:comunic/helpers/conversations_helper.dart';
 | 
			
		||||
import 'package:comunic/helpers/events_helper.dart';
 | 
			
		||||
import 'package:comunic/models/conversation.dart';
 | 
			
		||||
import 'package:comunic/ui/dialogs/screen_dialog.dart';
 | 
			
		||||
import 'package:comunic/ui/routes/main_route/main_route.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_screen.dart';
 | 
			
		||||
@@ -16,7 +17,7 @@ import 'package:flutter/material.dart';
 | 
			
		||||
///
 | 
			
		||||
/// @author Pierre Hubert
 | 
			
		||||
 | 
			
		||||
enum _Actions { OPEN_MEMBERS, OPEN_SETTINGS }
 | 
			
		||||
enum _Actions { START_CALL, OPEN_MEMBERS, OPEN_SETTINGS }
 | 
			
		||||
 | 
			
		||||
class ConversationWindow extends StatefulWidget {
 | 
			
		||||
  final int convID;
 | 
			
		||||
@@ -127,6 +128,13 @@ class _ConversationWindowState extends SafeState<ConversationWindow> {
 | 
			
		||||
      action: <Widget>[
 | 
			
		||||
        PopupMenuButton<_Actions>(
 | 
			
		||||
          itemBuilder: (c) => [
 | 
			
		||||
            // Start a new call
 | 
			
		||||
            PopupMenuItem(
 | 
			
		||||
              child: Text(tr("Start call")),
 | 
			
		||||
              value: _Actions.START_CALL,
 | 
			
		||||
              enabled: _conversation.callCapabilities != CallCapabilities.NONE,
 | 
			
		||||
            ),
 | 
			
		||||
 | 
			
		||||
            // Show the list of members
 | 
			
		||||
            PopupMenuItem(
 | 
			
		||||
              child: Text(tr("Members")),
 | 
			
		||||
@@ -151,6 +159,10 @@ class _ConversationWindowState extends SafeState<ConversationWindow> {
 | 
			
		||||
 | 
			
		||||
  void _menuCallback(_Actions value) {
 | 
			
		||||
    switch (value) {
 | 
			
		||||
      case _Actions.START_CALL:
 | 
			
		||||
        MainController.of(context).startCall(_convID);
 | 
			
		||||
        break;
 | 
			
		||||
 | 
			
		||||
      case _Actions.OPEN_MEMBERS:
 | 
			
		||||
        _openMembersList();
 | 
			
		||||
        break;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user