Skip to content

Commit e2d397e

Browse files
authored
chore(repo): remove deprecated members (#1107)
* removed deprecated apis and members * linter fixes * fix
1 parent 3f0400f commit e2d397e

21 files changed

+43
-593
lines changed

packages/stream_video/CHANGELOG.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
## Unreleased
22

3+
🚧 Breaking changes
4+
- Removed deprecated APIs and parameters. Migrate as follows:
5+
- `StreamVideo.muteVideoWhenInBackground``StreamVideo.options.muteVideoWhenInBackground`
6+
- `StreamVideo.muteAudioWhenInBackground``StreamVideo.options.muteAudioWhenInBackground`
7+
- Default `StreamCallType()` constructor → `StreamCallType.defaultType()`
8+
- `Call.setParticipantPinned()``Call.setParticipantPinnedLocally()` (local-only pin)
9+
- Removed deprecated `startRtmpBroadcasts` parameter from `Call.goLive()`
10+
- Removed `localParticipant` parameter from `AddReactionOption` constructor
11+
- Removed multiple deprecated builder callbacks in favor of [callbacks that don't provide the state object](https://github.com/GetStream/stream-video-flutter/pull/983); corresponding state object parameters in affected widgets have been removed.
12+
13+
### API renames and type changes
14+
15+
- `onCallKitEvent``onRingingEvent`
16+
- `observeCoreCallKitEvents``observeCoreRingingEvents`
17+
- `observeCallAcceptCallKitEvent``observeCallAcceptRingingEvent`
18+
- `observeCallDeclinedCallKitEvent``observeCallDeclinedRingingEvent`
19+
- `observeCallEndedCallKitEvent``observeCallEndedRingingEvent`
20+
- `CallKitEvent` (type) → `RingingEvent`
21+
322
✅ Added
423
- Introduced a new method in the `Call` class that allows ringing individual members of an existing call. Use `call.ring(userId: ['userId'])` to have the backend send a VoIP/ringing push notification to the user's devices. Note: the user must first be a member of the call (use `call.addMembers()` if needed).
524

@@ -21,17 +40,6 @@
2140

2241
## 0.11.1
2342

24-
🚧 Breaking changes
25-
26-
### API renames and type changes
27-
28-
- `onCallKitEvent``onRingingEvent`
29-
- `observeCoreCallKitEvents``observeCoreRingingEvents`
30-
- `observeCallAcceptCallKitEvent``observeCallAcceptRingingEvent`
31-
- `observeCallDeclinedCallKitEvent``observeCallDeclinedRingingEvent`
32-
- `observeCallEndedCallKitEvent``observeCallEndedRingingEvent`
33-
- `CallKitEvent` (type) → `RingingEvent`
34-
3543
🔄 Changed
3644
- The `byParticipantSource` participant sorting now accepts a list of sources. The default sorting for `speaker` and `livestream` presets now include other ingress sources.
3745

packages/stream_video/lib/src/call/call.dart

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3068,21 +3068,6 @@ class Call {
30683068
return const Result.success(none);
30693069
}
30703070

3071-
@Deprecated('Use setParticipantPinnedLocally instead')
3072-
Future<Result<None>> setParticipantPinned({
3073-
required String sessionId,
3074-
required String userId,
3075-
required bool pinned,
3076-
}) async {
3077-
setParticipantPinnedLocally(
3078-
sessionId: sessionId,
3079-
userId: userId,
3080-
pinned: pinned,
3081-
);
3082-
3083-
return const Result.success(none);
3084-
}
3085-
30863071
/// Pins/unpins the given session to the top of the participants list.
30873072
/// The change is done locally and won't affect other participants.
30883073
void setParticipantPinnedLocally({
@@ -3118,10 +3103,6 @@ class Call {
31183103
/// Starts the livestreaming of the call.
31193104
Future<Result<CallMetadata>> goLive({
31203105
bool? startHls,
3121-
@Deprecated(
3122-
'RTMP broadcast initiation should be managed by the backend. This property is no longer used.',
3123-
)
3124-
bool? startRtmpBroadcasts,
31253106
bool? startRecording,
31263107
bool? startTranscription,
31273108
bool? startClosedCaption,

packages/stream_video/lib/src/call/call_type.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import 'package:equatable/equatable.dart';
22

33
/// The type of call to be made.
44
///
5-
/// The default type is [StreamCallType()] which is a normal call.
6-
///
5+
/// [StreamCallType.defaultType()] is used for default calls.
76
/// [StreamCallType.liveStream()] is used for live streaming.
87
/// [StreamCallType.audioRoom()] is used for audio rooms.
98
/// [StreamCallType.development()] is used for development.
@@ -13,9 +12,6 @@ import 'package:equatable/equatable.dart';
1312
/// StreamCallType.custom('custom_type');
1413
/// ```
1514
class StreamCallType with EquatableMixin {
16-
@Deprecated('Use StreamCallType.defaultType() instead')
17-
factory StreamCallType() => const StreamCallType._('default');
18-
1915
const StreamCallType._(this.value);
2016

2117
factory StreamCallType.defaultType() => const StreamCallType._('default');

packages/stream_video/lib/src/stream_video.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,6 @@ class StreamVideo extends Disposable {
264264
final StreamVideoOptions _options;
265265
final String apiKey;
266266

267-
@Deprecated('Use options.muteVideoWhenInBackground instead')
268-
bool get muteVideoWhenInBackground => _options.muteVideoWhenInBackground;
269-
@Deprecated('Use options.muteAudioWhenInBackground instead')
270-
bool get muteAudioWhenInBackground => _options.muteAudioWhenInBackground;
271-
272267
final MutableClientState _state;
273268

274269
StreamVideoOptions get options => _options;

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,12 @@ class AddReactionOption extends StatefulWidget {
99
const AddReactionOption({
1010
super.key,
1111
required this.call,
12-
@Deprecated('localParticipant is no longer used') this.localParticipant,
1312
this.reactionIcon = Icons.add_reaction_outlined,
1413
});
1514

1615
/// Represents a call.
1716
final Call call;
1817

19-
/// The current local participant.
20-
@Deprecated('localParticipant is no longer used')
21-
final CallParticipantState? localParticipant;
22-
2318
/// The icon that is shown when the camera is enabled.
2419
final IconData reactionIcon;
2520

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

Lines changed: 0 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -6,63 +6,6 @@ import 'package:flutter/material.dart';
66

77
import '../../stream_video_flutter.dart';
88

9-
/// Builder used to create a custom incoming call widget.
10-
///
11-
/// Replaced by the simplified [CallWidgetBuilder].
12-
@Deprecated('Use CallWidgetBuilder instead.')
13-
typedef IncomingCallBuilder =
14-
Widget Function(
15-
BuildContext context,
16-
Call call,
17-
CallState callState,
18-
);
19-
20-
/// Builder used to create a custom outgoing call widget.
21-
///
22-
/// Replaced by the simplified [CallWidgetBuilder].
23-
@Deprecated('Use CallWidgetBuilder instead.')
24-
typedef OutgoingCallBuilder =
25-
Widget Function(
26-
BuildContext context,
27-
Call call,
28-
CallState callState,
29-
);
30-
31-
/// Builder used to create a custom call content widget.
32-
///
33-
/// Replaced by the simplified [CallWidgetBuilder].
34-
@Deprecated('Use CallWidgetBuilder instead.')
35-
typedef CallContentBuilder =
36-
Widget Function(
37-
BuildContext context,
38-
Call call,
39-
CallState callState,
40-
);
41-
42-
/// Builder used to create a custom widget for participants avatars.
43-
///
44-
/// Replaced by the simplified [CallWidgetBuilder].
45-
@Deprecated('Use CallWidgetBuilder instead.')
46-
typedef ParticipantsAvatarBuilder =
47-
Widget Function(
48-
BuildContext context,
49-
Call call,
50-
CallState callState,
51-
List<UserInfo> participants,
52-
);
53-
54-
/// Builder used to create a custom widget for participants display names.
55-
///
56-
/// Replaced by the simplified [CallWidgetBuilder].
57-
@Deprecated('Use CallWidgetBuilder instead.')
58-
typedef ParticipantsDisplayNameBuilder =
59-
Widget Function(
60-
BuildContext context,
61-
Call call,
62-
CallState callState,
63-
List<UserInfo> participants,
64-
);
65-
669
/// Represents different call content based on the call state.
6710
class StreamCallContainer extends StatefulWidget {
6811
/// Creates a new instance of [StreamCallContainer].
@@ -76,14 +19,8 @@ class StreamCallContainer extends StatefulWidget {
7619
this.onDeclineCallTap,
7720
this.onCancelCallTap,
7821
this.onCallDisconnected,
79-
@Deprecated('Use [incomingCallWidgetBuilder] instead.')
80-
this.incomingCallBuilder,
8122
this.incomingCallWidgetBuilder,
82-
@Deprecated('Use [outgoingCallWidgetBuilder] instead.')
83-
this.outgoingCallBuilder,
8423
this.outgoingCallWidgetBuilder,
85-
@Deprecated('Use [callContentWidgetBuilder] instead.')
86-
this.callContentBuilder,
8724
this.callContentWidgetBuilder,
8825
this.pictureInPictureConfiguration = const PictureInPictureConfiguration(),
8926
});
@@ -112,47 +49,18 @@ class StreamCallContainer extends StatefulWidget {
11249
/// The action to perform when the call is disconnected. By default, it pops the current route.
11350
final void Function(CallDisconnectedProperties)? onCallDisconnected;
11451

115-
/// Builder used to create a custom incoming call widget.
116-
///
117-
/// If [incomingCallBuilder] is provided, the whole [StreamCallContainer] widget will
118-
/// rebuild on every call state change.
119-
/// Recommend to use [incomingCallWidgetBuilder] which is not rebuild on every state change.
120-
@Deprecated('Use [incomingCallWidgetBuilder] instead.')
121-
final IncomingCallBuilder? incomingCallBuilder;
122-
12352
/// Builder used to create a custom incoming call widget.
12453
final CallWidgetBuilder? incomingCallWidgetBuilder;
12554

126-
/// Builder used to create a custom outgoing call widget.
127-
///
128-
/// If [outgoingCallBuilder] is provided, the whole [StreamCallContainer] widget will
129-
/// rebuild on every call state change.
130-
/// Recommend to use [outgoingCallWidgetBuilder] which is not rebuild on every state change.
131-
@Deprecated('Use [outgoingCallWidgetBuilder] instead.')
132-
final OutgoingCallBuilder? outgoingCallBuilder;
133-
13455
/// Builder used to create a custom outgoing call widget.
13556
final CallWidgetBuilder? outgoingCallWidgetBuilder;
13657

137-
/// Builder used to create a custom call content widget.
138-
///
139-
/// If [callContentBuilder] is provided, the whole [StreamCallContainer] widget will
140-
/// rebuild on every call state change.
141-
/// Recommend to use [callContentWidgetBuilder] which is not rebuild on every state change.
142-
@Deprecated('Use [callContentWidgetBuilder] instead.')
143-
final CallContentBuilder? callContentBuilder;
144-
14558
/// Builder used to create a custom call content widget.
14659
final CallWidgetBuilder? callContentWidgetBuilder;
14760

14861
/// Configuration for picture-in-picture mode.
14962
final PictureInPictureConfiguration pictureInPictureConfiguration;
15063

151-
bool get _shouldListenToCallState =>
152-
incomingCallBuilder != null ||
153-
outgoingCallBuilder != null ||
154-
callContentBuilder != null;
155-
15664
@override
15765
State<StreamCallContainer> createState() => _StreamCallContainerState();
15866
}
@@ -165,16 +73,12 @@ class _StreamCallContainerState extends State<StreamCallContainer> {
16573
/// Represents a call.
16674
Call get call => widget.call;
16775

168-
/// Holds all information about the call.
169-
CallState? _callState;
170-
17176
/// Holds only status information about the call.
17277
late CallStatus _callStatus;
17378

17479
@override
17580
void initState() {
17681
super.initState();
177-
_listenToCallStateIfNeeded();
17882
_listenToCallStatus();
17983
_connect();
18084
}
@@ -188,7 +92,6 @@ class _StreamCallContainerState extends State<StreamCallContainer> {
18892
_callStatusSubscription?.cancel();
18993
_callStatusSubscription = null;
19094

191-
_listenToCallStateIfNeeded();
19295
_listenToCallStatus();
19396
}
19497
}
@@ -202,29 +105,13 @@ class _StreamCallContainerState extends State<StreamCallContainer> {
202105
super.dispose();
203106
}
204107

205-
void _listenToCallStateIfNeeded() {
206-
if (widget._shouldListenToCallState) {
207-
_callState = call.state.value;
208-
_callStateSubscription = call.state.listen(_setState);
209-
} else {
210-
_callState = null;
211-
}
212-
}
213-
214108
void _listenToCallStatus() {
215109
_callStatus = call.state.value.status;
216110
_callStatusSubscription = call
217111
.partialState((state) => state.status)
218112
.listen(_setStatus);
219113
}
220114

221-
void _setState(CallState callState) {
222-
_logger.v(() => '[setState] callState.status: ${callState.status}');
223-
setState(() {
224-
_callState = callState;
225-
});
226-
}
227-
228115
void _setStatus(CallStatus callStatus) {
229116
_logger.v(() => '[setStatus] callState.status: $callStatus');
230117
setState(() {
@@ -286,46 +173,26 @@ class _StreamCallContainerState extends State<StreamCallContainer> {
286173
}
287174

288175
Widget _buildIncomingCall() {
289-
assert(
290-
_callState != null || widget.incomingCallBuilder == null,
291-
'Call state is supposed to be available to build the incoming call widget.',
292-
);
293-
294176
return widget.incomingCallWidgetBuilder?.call(context, call) ??
295-
widget.incomingCallBuilder?.call(context, call, _callState!) ??
296177
StreamIncomingCallContent(
297178
call: call,
298-
callState: _callState,
299179
onAcceptCallTap: widget.onAcceptCallTap,
300180
onDeclineCallTap: widget.onDeclineCallTap,
301181
);
302182
}
303183

304184
Widget _buildOutgoingCall() {
305-
assert(
306-
_callState != null || widget.outgoingCallBuilder == null,
307-
'Call state is supposed to be available to build the outgoing call widget.',
308-
);
309185
return widget.outgoingCallWidgetBuilder?.call(context, call) ??
310-
widget.outgoingCallBuilder?.call(context, call, _callState!) ??
311186
StreamOutgoingCallContent(
312187
call: call,
313-
callState: _callState,
314188
onCancelCallTap: widget.onCancelCallTap,
315189
);
316190
}
317191

318192
Widget _buildCallContent() {
319-
assert(
320-
_callState != null || widget.callContentBuilder == null,
321-
'Call state is supposed to be available to build the call content widget.',
322-
);
323-
324193
return widget.callContentWidgetBuilder?.call(context, call) ??
325-
widget.callContentBuilder?.call(context, call, _callState!) ??
326194
StreamCallContent(
327195
call: call,
328-
callState: _callState,
329196
onBackPressed: widget.onBackPressed,
330197
onLeaveCallTap: widget.onLeaveCallTap,
331198
pictureInPictureConfiguration: widget.pictureInPictureConfiguration,

0 commit comments

Comments
 (0)