Skip to content

Commit 51a3072

Browse files
authored
fixing on leave call callback (#748)
1 parent 5674ec1 commit 51a3072

File tree

6 files changed

+11
-5
lines changed

6 files changed

+11
-5
lines changed

packages/stream_video/lib/src/webrtc/peer_connection.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ class StreamPeerConnection extends Disposable {
378378

379379
@override
380380
Future<void> dispose() async {
381+
_logger.d(() => '[dispose] no args');
381382
_dropRtcCallbacks();
382383
_stopObservingStats();
383384
onStreamAdded = null;

packages/stream_video/lib/src/webrtc/rtc_manager.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ class RtcManager extends Disposable {
226226

227227
@override
228228
Future<void> dispose() async {
229+
_logger.d(() => '[dispose] no args');
229230
for (final trackSid in [...publishedTracks.keys]) {
230231
await unpublishTrack(trackId: trackSid);
231232
}

packages/stream_video_flutter/lib/src/call_controls/call_controls.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ class StreamCallControls extends StatelessWidget {
2222
factory StreamCallControls.withDefaultOptions({
2323
required Call call,
2424
required CallParticipantState localParticipant,
25-
VoidCallback? onLeaveCallTap,
2625
Color? backgroundColor,
2726
double? elevation,
2827
double? spacing,
@@ -33,7 +32,6 @@ class StreamCallControls extends StatelessWidget {
3332
options: defaultCallControlOptions(
3433
call: call,
3534
localParticipant: localParticipant,
36-
onLeaveCallTap: onLeaveCallTap,
3735
),
3836
backgroundColor: backgroundColor,
3937
elevation: elevation,

packages/stream_video_flutter/lib/src/call_controls/controls/default_control_options.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import '../../../stream_video_flutter.dart';
66
List<Widget> defaultCallControlOptions({
77
required Call call,
88
required CallParticipantState localParticipant,
9-
VoidCallback? onLeaveCallTap,
109
}) {
1110
return [
1211
ToggleSpeakerphoneOption(call: call),

packages/stream_video_flutter/lib/src/call_screen/call_content/call_app_bar.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class CallAppBar extends StatelessWidget implements PreferredSizeWidget {
1313
this.elevation = 1,
1414
this.backgroundColor,
1515
this.onBackPressed,
16+
this.onLeaveCallTap,
1617
this.leading,
1718
this.leadingWidth,
1819
this.title,
@@ -37,6 +38,9 @@ class CallAppBar extends StatelessWidget implements PreferredSizeWidget {
3738
/// The action to perform when the back button is pressed.
3839
final VoidCallback? onBackPressed;
3940

41+
/// The action to perform when the leave call button is tapped.
42+
final VoidCallback? onLeaveCallTap;
43+
4044
/// The leading widget to display.
4145
final Widget? leading;
4246

@@ -84,7 +88,10 @@ class CallAppBar extends StatelessWidget implements PreferredSizeWidget {
8488
if (showLeaveCallAction)
8589
Transform.scale(
8690
scale: 0.8,
87-
child: LeaveCallOption(call: call),
91+
child: LeaveCallOption(
92+
call: call,
93+
onLeaveCallTap: onLeaveCallTap,
94+
),
8895
),
8996
],
9097
title: title ??

packages/stream_video_flutter/lib/src/call_screen/call_content/call_content.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ class _StreamCallContentState extends State<StreamCallContent>
216216
CallAppBar(
217217
call: call,
218218
onBackPressed: widget.onBackPressed,
219+
onLeaveCallTap: widget.onLeaveCallTap,
219220
),
220221
body: Stack(
221222
children: [
@@ -250,7 +251,6 @@ class _StreamCallContentState extends State<StreamCallContent>
250251
StreamCallControls.withDefaultOptions(
251252
call: call,
252253
localParticipant: localParticipant,
253-
onLeaveCallTap: widget.onLeaveCallTap,
254254
)
255255
: null,
256256
);

0 commit comments

Comments
 (0)