From cf9f93dcb3c67f4b9c0caf6f1fcd069db767ee5d Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sun, 10 May 2020 14:36:33 +0200 Subject: [PATCH] Improve code --- lib/ui/screens/call_screen.dart | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/ui/screens/call_screen.dart b/lib/ui/screens/call_screen.dart index 53e1074..98fe75e 100644 --- a/lib/ui/screens/call_screen.dart +++ b/lib/ui/screens/call_screen.dart @@ -28,6 +28,8 @@ enum _PopupMenuOption { STOP_STREAMING, SWITCH_CAMERA } class CallScreen extends StatefulWidget { final int convID; + + /// This settings should be always true except for the small call window... final bool floatingButtons; const CallScreen({ @@ -483,11 +485,16 @@ class _CallScreenState extends SafeState { return Column( children: [ + // Members list _canHideMenuBar ? Container() : _buildMembersArea(), + + // Build videos area (+ buttons if floating) Expanded(child: LayoutBuilder(builder: _buildVideosArea)), - _canHideMenuBar || widget.floatingButtons - ? Container() - : _buildFooterArea() + + // Buttons bar (if buttons are not floating) + !_canHideMenuBar && !widget.floatingButtons + ? _buildFooterArea() + : Container(), ], ); } @@ -554,11 +561,11 @@ class _CallScreenState extends SafeState { ? _buildLocalVideo() : Container(), - // Buttons bar - _canHideMenuBar || !widget.floatingButtons - ? Container() - : Positioned( + // Buttons bar (if floating) + !_canHideMenuBar && widget.floatingButtons + ? Positioned( bottom: 10, right: 0, left: 0, child: _buildFooterArea()) + : Container(), ], ); }