1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-25 22:39:22 +00:00

Make close window button lives

This commit is contained in:
Pierre HUBERT 2020-05-10 15:07:20 +02:00
parent 476f08681b
commit 6bdaf83563
2 changed files with 11 additions and 1 deletions

View File

@ -36,11 +36,17 @@ class CallScreen extends StatefulWidget {
/// String which is the title of the conversation /// String which is the title of the conversation
final PreferredSizeWidget Function(String) buildCustomAppBar; 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({ const CallScreen({
Key key, Key key,
@required this.convID, @required this.convID,
this.floatingButtons = true, this.floatingButtons = true,
this.buildCustomAppBar, this.buildCustomAppBar,
this.onClose,
}) : assert(convID != null), }) : assert(convID != null),
assert(convID > 0), assert(convID > 0),
assert(floatingButtons != null), assert(floatingButtons != null),
@ -198,7 +204,10 @@ class _CallScreenState extends SafeState<CallScreen> {
context: context, context: context,
message: tr("Do you really want to leave this call ?"))) return; 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 /// Start streaming on our end

View File

@ -63,6 +63,7 @@ class _CallWindowWidgetState extends State<CallWindowWidget> {
)), )),
convID: widget.convID, convID: widget.convID,
floatingButtons: false, floatingButtons: false,
onClose: widget.onClose,
), ),
), ),
feedback: Container( feedback: Container(