Skip to content

Commit cc33ba3

Browse files
authored
chore(repo): remove deprecated classes, methods, and properties (#2306)
1 parent 74188e3 commit cc33ba3

File tree

56 files changed

+97
-3537
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+97
-3537
lines changed

packages/stream_chat/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## Upcoming Beta
2+
3+
🛑️ Breaking
4+
5+
- **Deprecated API Cleanup**: Removed all deprecated classes, methods, and properties for the v10 major release:
6+
- **Removed Classes**: `PermissionType` (use string constants like `'delete-channel'`, `'update-channel'`), `CallApi`, `CallPayload`, `CallTokenPayload`, `CreateCallPayload`
7+
- **Removed Methods**: `cooldownStartedAt` getter from `Channel`, `getCallToken` and `createCall` from `StreamChatClient`
8+
- **Removed Properties**: `reactionCounts` and `reactionScores` getters from `Message` (use `reactionGroups` instead), `call` property from `StreamChatApi`
9+
- **Removed Files**: `permission_type.dart`, `call_api.dart`, `call_payload.dart` and their associated tests
10+
111
## Upcoming
212

313
🐞 Fixed

packages/stream_chat/lib/src/client/channel.dart

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -306,15 +306,6 @@ class Channel {
306306
return math.max(0, cooldownDuration - elapsedTime);
307307
}
308308

309-
/// Stores time at which cooldown was started
310-
@Deprecated(
311-
"Use a combination of 'remainingCooldown' and 'currentUserLastMessageAt'",
312-
)
313-
DateTime? get cooldownStartedAt {
314-
if (getRemainingCooldown() <= 0) return null;
315-
return currentUserLastMessageAt;
316-
}
317-
318309
/// Channel creation date.
319310
DateTime? get createdAt {
320311
_checkInitialized();

packages/stream_chat/lib/src/client/client.dart

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -695,27 +695,6 @@ class StreamChatClient {
695695
}
696696
}
697697

698-
/// Returns a token associated with the [callId].
699-
@Deprecated('Will be removed in the next major version')
700-
Future<CallTokenPayload> getCallToken(String callId) async =>
701-
_chatApi.call.getCallToken(callId);
702-
703-
/// Creates a new call.
704-
@Deprecated('Will be removed in the next major version')
705-
Future<CreateCallPayload> createCall({
706-
required String callId,
707-
required String callType,
708-
required String channelType,
709-
required String channelId,
710-
}) {
711-
return _chatApi.call.createCall(
712-
callId: callId,
713-
callType: callType,
714-
channelType: channelType,
715-
channelId: channelId,
716-
);
717-
}
718-
719698
/// Requests channels with a given query from the API.
720699
Future<List<Channel>> queryChannelsOnline({
721700
Filter? filter,

packages/stream_chat/lib/src/core/api/call_api.dart

Lines changed: 0 additions & 42 deletions
This file was deleted.

packages/stream_chat/lib/src/core/api/responses.dart

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import 'package:json_annotation/json_annotation.dart';
22
import 'package:stream_chat/src/client/client.dart';
3-
import 'package:stream_chat/src/core/api/call_api.dart';
43
import 'package:stream_chat/src/core/error/error.dart';
54
import 'package:stream_chat/src/core/models/banned_user.dart';
6-
import 'package:stream_chat/src/core/models/call_payload.dart';
75
import 'package:stream_chat/src/core/models/channel_model.dart';
86
import 'package:stream_chat/src/core/models/channel_state.dart';
97
import 'package:stream_chat/src/core/models/device.dart';
@@ -513,36 +511,6 @@ class OGAttachmentResponse extends _BaseResponse {
513511
_$OGAttachmentResponseFromJson(json);
514512
}
515513

516-
/// The response to [CallApi.getCallToken]
517-
@Deprecated('Will be removed in the next major version')
518-
@JsonSerializable(createToJson: false)
519-
class CallTokenPayload extends _BaseResponse {
520-
/// Create a new instance from a [json].
521-
static CallTokenPayload fromJson(Map<String, dynamic> json) =>
522-
_$CallTokenPayloadFromJson(json);
523-
524-
/// The token to use for the call.
525-
String? token;
526-
527-
/// The user id specific to Agora.
528-
int? agoraUid;
529-
530-
/// The appId specific to Agora.
531-
String? agoraAppId;
532-
}
533-
534-
/// The response to [CallApi.createCall]
535-
@Deprecated('Will be removed in the next major version')
536-
@JsonSerializable(createToJson: false)
537-
class CreateCallPayload extends _BaseResponse {
538-
/// Create a new instance from a [json].
539-
static CreateCallPayload fromJson(Map<String, dynamic> json) =>
540-
_$CreateCallPayloadFromJson(json);
541-
542-
/// The call object.
543-
CallPayload? call;
544-
}
545-
546514
/// Contains information about a [User] that was banned from a [Channel] or App.
547515
@JsonSerializable(createToJson: false)
548516
class UserBlockResponse extends _BaseResponse {

packages/stream_chat/lib/src/core/api/responses.g.dart

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/stream_chat/lib/src/core/api/sort_order.dart

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,8 @@ enum NullOrdering {
3434
/// // Sort channels by last message date in descending order
3535
/// final sort = SortOption<ChannelState>("last_message_at");
3636
/// ```
37-
@JsonSerializable(includeIfNull: false)
37+
@JsonSerializable(createFactory: false, includeIfNull: false)
3838
class SortOption<T extends ComparableFieldProvider> {
39-
/// Creates a new SortOption instance with the specified field and direction.
40-
///
41-
/// ```dart
42-
/// final sorting = SortOption("last_message_at") // Default: descending order
43-
/// ```
44-
@Deprecated('Use SortOption.desc or SortOption.asc instead')
45-
const SortOption(
46-
this.field, {
47-
this.direction = SortOption.DESC,
48-
this.nullOrdering = NullOrdering.nullsFirst,
49-
Comparator<T>? comparator,
50-
}) : _comparator = comparator;
51-
5239
/// Creates a SortOption for descending order sorting by the specified field.
5340
///
5441
/// Example:
@@ -77,10 +64,6 @@ class SortOption<T extends ComparableFieldProvider> {
7764
}) : direction = SortOption.ASC,
7865
_comparator = comparator;
7966

80-
/// Create a new instance from JSON.
81-
factory SortOption.fromJson(Map<String, dynamic> json) =>
82-
_$SortOptionFromJson(json);
83-
8467
/// Ascending order (1)
8568
static const ASC = 1;
8669

packages/stream_chat/lib/src/core/api/sort_order.g.dart

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/stream_chat/lib/src/core/api/stream_chat_api.dart

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import 'package:dio/dio.dart';
22
import 'package:logging/logging.dart';
33
import 'package:stream_chat/src/core/api/attachment_file_uploader.dart';
4-
import 'package:stream_chat/src/core/api/call_api.dart';
54
import 'package:stream_chat/src/core/api/channel_api.dart';
65
import 'package:stream_chat/src/core/api/device_api.dart';
76
import 'package:stream_chat/src/core/api/general_api.dart';
@@ -70,12 +69,6 @@ class StreamChatApi {
7069
ThreadsApi get threads => _threads ??= ThreadsApi(_client);
7170
ThreadsApi? _threads;
7271

73-
/// Api dedicated to call operations
74-
@Deprecated('Will be removed in the next major version')
75-
CallApi get call => _call ??= CallApi(_client);
76-
@Deprecated('Will be removed in the next major version')
77-
CallApi? _call;
78-
7972
/// Api dedicated to channel operations
8073
ChannelApi get channel => _channel ??= ChannelApi(_client);
8174
ChannelApi? _channel;

packages/stream_chat/lib/src/core/models/call_payload.dart

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)