1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-26 23:09:21 +00:00
comunicmobile/lib/ui/widgets/tablet_mode/calls/calls_area.dart

38 lines
857 B
Dart

import 'package:comunic/ui/widgets/tablet_mode/calls/call_window_widget.dart';
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> {
final _openCalls = Map<int, Key>();
@override
Widget build(BuildContext context) {
return Stack(
children: _openCalls
.map((convID, key) =>
MapEntry(convID, CallWindowWidget(key: key, convID: convID)))
.values
.toList(),
);
}
/// Open a new call
void openCall(int convID) {
if (!_openCalls.containsKey(convID)) {
setState(() {
_openCalls[convID] = UniqueKey();
});
}
}
}