StreamCallContainer(
call: widget.call,
callConnectOptions: widget.connectOptions,
onCancelCallTap: () async {
await widget.call.reject(reason: CallRejectReason.cancel());
},
callContentBuilder: (
BuildContext context,
Call call,
CallState callState,
) {
return StreamCallContent(
call: call,
callState: callState,
callAppBarBuilder: (context, call, callState) {
return CallAppBar(
call: call,
leadingWidth: 120,
leading: Row(
children: [
ToggleLayoutOption(
onLayoutModeChanged: (layout) {
setState(() {
_currentLayoutMode = layout;
});
},
),
if (call.state.valueOrNull?.localParticipant != null)
FlipCameraOption(
call: call,
localParticipant: call.state.value.localParticipant!,
),
],
),
title: CallDurationTitle(call: call),
);
},
);
},
)
Call AppBar
The default AppBar provided by the StreamCallContent
widget includes essential features such as:
- A back button to navigate out of the call.
- Call status information.
- An action to leave the call.
If you want to customize the AppBar to better fit your app’s design or functionality, you can use the callAppBarBuilder
. This allows you to replace or modify the default AppBar while maintaining the core functionality provided by the SDK.
In the following example (from our dogfooding sample app), the default app bar is modified to include ToggleLayoutOption
and FlipCameraOption
actions on the left. Both of these widgets are part of our SDK and can be used to further personalize your UI.
Additionally, the example below uses a custom CallDurationTitle
widget to display the call’s duration.