diff --git a/lib/ui/widgets/tablet_mode/calls/call_window_widget.dart b/lib/ui/widgets/tablet_mode/calls/call_window_widget.dart index b3ab716..f7744b2 100644 --- a/lib/ui/widgets/tablet_mode/calls/call_window_widget.dart +++ b/lib/ui/widgets/tablet_mode/calls/call_window_widget.dart @@ -29,6 +29,10 @@ class CallWindowWidget extends StatefulWidget { class _CallWindowWidgetState extends State { double _left, _top; + var _fullScreen = false; + + final _callScreenKey = GlobalKey(); + @override void didChangeDependencies() { super.didChangeDependencies(); @@ -40,6 +44,8 @@ class _CallWindowWidgetState extends State { @override Widget build(BuildContext context) { + if (_fullScreen) return _buildScreen(); + return Positioned( width: _WindowSize.width, height: _WindowSize.height, @@ -47,24 +53,7 @@ class _CallWindowWidgetState extends State { top: _top, child: Draggable( child: Card( - child: CallScreen( - buildCustomAppBar: (convName) => AppBarWrapper( - height: 30, - appBar: AppBar( - backgroundColor: Colors.black, - title: Text(convName == null ? tr("Loading...") : convName), - actions: [ - IconButton( - iconSize: 16, - icon: Icon(Icons.close), - onPressed: widget.onClose, - ) - ], - )), - convID: widget.convID, - floatingButtons: false, - onClose: widget.onClose, - ), + child: _buildScreen(), ), feedback: Container( width: _WindowSize.width, @@ -76,6 +65,35 @@ class _CallWindowWidgetState extends State { ); } + Widget _buildScreen() => CallScreen( + key: _callScreenKey, + buildCustomAppBar: (convName) => AppBarWrapper( + height: 30, + appBar: AppBar( + backgroundColor: Colors.black, + title: Text(convName == null ? tr("Loading...") : convName), + actions: [ + // Go full screen + IconButton( + iconSize: 16, + icon: Icon( + _fullScreen ? Icons.fullscreen_exit : Icons.fullscreen), + onPressed: _toggleFullScreen, + ), + + // Close call + IconButton( + iconSize: 16, + icon: Icon(Icons.close), + onPressed: widget.onClose, + ) + ], + )), + convID: widget.convID, + floatingButtons: _fullScreen, + onClose: widget.onClose, + ); + /// Compute new window position void _moveEnd(DraggableDetails details) { // Determine the limits of containing stack @@ -101,4 +119,6 @@ class _CallWindowWidgetState extends State { setState(() {}); } + + void _toggleFullScreen() => setState(() => _fullScreen = !_fullScreen); }