mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 12:59:21 +00:00
Start to show call window
This commit is contained in:
parent
63a8e61e80
commit
b40308c9e4
32
lib/ui/widgets/tablet_mode/calls/call_window_widget.dart
Normal file
32
lib/ui/widgets/tablet_mode/calls/call_window_widget.dart
Normal file
@ -0,0 +1,32 @@
|
||||
import 'package:comunic/ui/screens/call_screen.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Call window widget
|
||||
///
|
||||
/// @author Pierre HUBERT
|
||||
|
||||
class CallWindowWidget extends StatefulWidget {
|
||||
final int convID;
|
||||
|
||||
const CallWindowWidget({
|
||||
Key key,
|
||||
this.convID,
|
||||
}) : assert(convID != null),
|
||||
super(key: key);
|
||||
|
||||
@override
|
||||
_CallWindowWidgetState createState() => _CallWindowWidgetState();
|
||||
}
|
||||
|
||||
class _CallWindowWidgetState extends State<CallWindowWidget> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Positioned(
|
||||
width: 500,
|
||||
height: 200,
|
||||
right: 10,
|
||||
top: 10,
|
||||
child: Card(child: CallScreen(convID: widget.convID)),
|
||||
);
|
||||
}
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
import 'package:comunic/utils/intl_utils.dart';
|
||||
import 'package:comunic/utils/ui_utils.dart';
|
||||
import 'package:comunic/ui/widgets/tablet_mode/calls/call_window_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Tablets mode calls area
|
||||
@ -14,13 +13,25 @@ class CallsArea extends StatefulWidget {
|
||||
}
|
||||
|
||||
class CallsAreaState extends State<CallsArea> {
|
||||
final _openCalls = Map<int, Key>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack();
|
||||
return Stack(
|
||||
children: _openCalls
|
||||
.map((convID, key) =>
|
||||
MapEntry(convID, CallWindowWidget(key: key, convID: convID)))
|
||||
.values
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
|
||||
/// Open a new call
|
||||
void openCall(int convID) {
|
||||
showSimpleSnack(context, tr("Open call $convID"));
|
||||
if (!_openCalls.containsKey(convID)) {
|
||||
setState(() {
|
||||
_openCalls[convID] = UniqueKey();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user