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
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<CallScreen> {
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

View File

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