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

Ready to implement calls screen

This commit is contained in:
Pierre HUBERT 2020-04-20 10:53:25 +02:00
parent f227209e9b
commit 0a03f581d1
3 changed files with 44 additions and 0 deletions

View File

@ -102,6 +102,17 @@ class _ConversationRouteState extends State<ConversationRoute> {
_conversationName == null ? tr("Loading") : _conversationName,
),
actions: <Widget>[
// Start call (if possible)
_conversation == null ||
_conversation.callCapabilities == CallCapabilities.NONE
? Container()
: IconButton(
icon: Icon(Icons.phone),
onPressed: () => MainController.of(context)
.startCall(widget.conversationID),
),
// Edit conversation settings
IconButton(
icon: Icon(Icons.settings),
onPressed: _openSettings,

View File

@ -2,6 +2,7 @@ import 'package:comunic/helpers/account_helper.dart';
import 'package:comunic/ui/routes/account_settings/account_settings_route.dart';
import 'package:comunic/ui/routes/app_settings_route.dart';
import 'package:comunic/ui/routes/conversation_route.dart';
import 'package:comunic/ui/screens/call_screen.dart';
import 'package:comunic/ui/screens/conversations_list_screen.dart';
import 'package:comunic/ui/screens/friends_list_screen.dart';
import 'package:comunic/ui/screens/group_screen.dart';
@ -75,6 +76,9 @@ abstract class MainController extends State<MainRoute> {
/// Open a conversation
void openConversation(int convID);
/// Start a call for a given conversation
void startCall(int convID);
}
/// Private implementation of HomeController
@ -287,4 +291,9 @@ class _MainRouteState extends MainController {
hideNavBar: true,
));
}
@override
void startCall(int convID) {
push(CallScreen(convID: convID), hideNavBar: true);
}
}

View File

@ -0,0 +1,24 @@
import 'package:flutter/material.dart';
/// Call screen
///
/// @author Pierre Hubert
class CallScreen extends StatefulWidget {
final int convID;
const CallScreen({Key key, @required this.convID})
: assert(convID != null),
assert(convID > 0),
super(key: key);
@override
_CallScreenState createState() => _CallScreenState();
}
class _CallScreenState extends State<CallScreen> {
@override
Widget build(BuildContext context) {
return Container();
}
}