1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-10-23 15:03:22 +00:00
comunicmobile/lib/ui/widgets/tablet_mode/calls/calls_area.dart

38 lines
857 B
Dart
Raw Normal View History

2020-05-10 11:46:45 +00:00
import 'package:comunic/ui/widgets/tablet_mode/calls/call_window_widget.dart';
2020-05-09 17:45:07 +00:00
import 'package:flutter/material.dart';
/// Tablets mode calls area
///
/// @author Pierre Hubert
class CallsArea extends StatefulWidget {
const CallsArea({Key key}) : super(key: key);
@override
CallsAreaState createState() => CallsAreaState();
}
class CallsAreaState extends State<CallsArea> {
2020-05-10 11:46:45 +00:00
final _openCalls = Map<int, Key>();
2020-05-09 17:45:07 +00:00
@override
Widget build(BuildContext context) {
2020-05-10 11:46:45 +00:00
return Stack(
children: _openCalls
.map((convID, key) =>
MapEntry(convID, CallWindowWidget(key: key, convID: convID)))
.values
.toList(),
);
2020-05-09 17:45:07 +00:00
}
/// Open a new call
void openCall(int convID) {
2020-05-10 11:46:45 +00:00
if (!_openCalls.containsKey(convID)) {
setState(() {
_openCalls[convID] = UniqueKey();
});
}
2020-05-09 17:45:07 +00:00
}
}