diff --git a/lib/ui/screens/call_screen.dart b/lib/ui/screens/call_screen.dart index a23bbc1..9785233 100644 --- a/lib/ui/screens/call_screen.dart +++ b/lib/ui/screens/call_screen.dart @@ -36,11 +36,17 @@ class CallScreen extends StatefulWidget { /// String which is the title of the conversation final PreferredSizeWidget Function(String) buildCustomAppBar; + /// Execute custom action when the call is closed + /// + /// The default behavior is to pop the page + final void Function() onClose; + const CallScreen({ Key key, @required this.convID, this.floatingButtons = true, this.buildCustomAppBar, + this.onClose, }) : assert(convID != null), assert(convID > 0), assert(floatingButtons != null), @@ -198,7 +204,10 @@ class _CallScreenState extends SafeState { context: context, message: tr("Do you really want to leave this call ?"))) return; - MainController.of(context).popPage(); + if (widget.onClose == null) + MainController.of(context).popPage(); + else + widget.onClose(); } /// Start streaming on our end 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 f18cef3..b3ab716 100644 --- a/lib/ui/widgets/tablet_mode/calls/call_window_widget.dart +++ b/lib/ui/widgets/tablet_mode/calls/call_window_widget.dart @@ -63,6 +63,7 @@ class _CallWindowWidgetState extends State { )), convID: widget.convID, floatingButtons: false, + onClose: widget.onClose, ), ), feedback: Container(