diff --git a/docs_code_snippets/05_06_notification_feeds.dart b/docs_code_snippets/05_06_notification_feeds.dart index f750816b..a200dc77 100644 --- a/docs_code_snippets/05_06_notification_feeds.dart +++ b/docs_code_snippets/05_06_notification_feeds.dart @@ -11,13 +11,13 @@ late Activity janeActivity; late Activity saraComment; Future creatingNotificationActivities() async { -// Eric follows Jane + // Eric follows Jane await ericFeed.follow( targetFid: janeFeed.fid, createNotificationActivity: true, // When true Jane's notification feed will be updated with follow activity ); -// Eric comments on Jane's activity + // Eric comments on Jane's activity await ericFeed.addComment( request: ActivityAddCommentRequest( comment: 'Agree!', @@ -26,7 +26,7 @@ Future creatingNotificationActivities() async { true, // When true Jane's notification feed will be updated with comment activity ), ); -// Eric reacts to Jane's activity + // Eric reacts to Jane's activity await ericFeed.addReaction( activityId: janeActivity.activityId, request: const AddReactionRequest( @@ -35,7 +35,7 @@ Future creatingNotificationActivities() async { true, // When true Jane's notification feed will be updated with reaction activity ), ); -// Eric reacts to a comment posted to Jane's activity by Sara + // Eric reacts to a comment posted to Jane's activity by Sara await ericFeed.addCommentReaction( commentId: saraComment.activityId, request: const AddCommentReactionRequest( diff --git a/docs_code_snippets/06_01_reactions.dart b/docs_code_snippets/06_01_reactions.dart index b0911cf8..e05fb210 100644 --- a/docs_code_snippets/06_01_reactions.dart +++ b/docs_code_snippets/06_01_reactions.dart @@ -17,8 +17,8 @@ Future overview() async { Future overviewRead() async { final feedData = await feed.getOrCreate(); -// Last 15 reactions on the first activity + // Last 15 reactions on the first activity print(feed.state.activities[0].latestReactions); -// Count of reactions by type + // Count of reactions by type print(feed.state.activities[0].reactionGroups); } diff --git a/docs_code_snippets/06_02_bookmarks.dart b/docs_code_snippets/06_02_bookmarks.dart index aae81c70..d712f273 100644 --- a/docs_code_snippets/06_02_bookmarks.dart +++ b/docs_code_snippets/06_02_bookmarks.dart @@ -6,14 +6,14 @@ late StreamFeedsClient client; late Feed feed; Future addingBookmarks() async { -// Adding a bookmark to a new folder + // Adding a bookmark to a new folder final bookmark = await feed.addBookmark(activityId: 'activity_123'); -// Adding to an existing folder + // Adding to an existing folder final bookmarkWithFolder = await feed.addBookmark( activityId: 'activity_123', request: const AddBookmarkRequest(folderId: 'folder_456'), ); -// Update a bookmark (without a folder initially) - add custom data and move it to a new folder + // Update a bookmark (without a folder initially) - add custom data and move it to a new folder final updatedBookmark = await feed.updateBookmark( activityId: 'activity_123', request: const UpdateBookmarkRequest( @@ -24,7 +24,7 @@ Future addingBookmarks() async { ), ), ); -// Update a bookmark - move it from one existing folder to another existing folder + // Update a bookmark - move it from one existing folder to another existing folder final movedBookmark = await feed.updateBookmark( activityId: 'activity_123', request: const UpdateBookmarkRequest( diff --git a/docs_code_snippets/06_03_comments.dart b/docs_code_snippets/06_03_comments.dart index 80d37deb..958ea351 100644 --- a/docs_code_snippets/06_03_comments.dart +++ b/docs_code_snippets/06_03_comments.dart @@ -6,7 +6,7 @@ late StreamFeedsClient client; late Feed feed; Future addingComments() async { -// Adding a comment to an activity + // Adding a comment to an activity final comment = await feed.addComment( request: const ActivityAddCommentRequest( comment: 'So great!', @@ -15,7 +15,7 @@ Future addingComments() async { activityType: 'activity', ), ); -// Adding a reply to a comment + // Adding a reply to a comment final reply = await feed.addComment( request: const ActivityAddCommentRequest( comment: 'I agree!', diff --git a/melos.yaml b/melos.yaml index 1d0dd2e8..c383f81c 100644 --- a/melos.yaml +++ b/melos.yaml @@ -40,15 +40,9 @@ command: rxdart: ^0.28.0 shared_preferences: ^2.5.3 state_notifier: ^1.0.0 + stream_core: ^0.1.0 uuid: ^4.5.1 - # TODO Replace with hosted version when published - stream_core: - git: - url: https://github.com/GetStream/stream-core-flutter.git - ref: 280b1045e39388668fd060439259831611b51b5a - path: packages/stream_core - # List of all the dev_dependencies used in the project. dev_dependencies: auto_route_generator: ^10.0.0 diff --git a/packages/stream_feeds/CHANGELOG.md b/packages/stream_feeds/CHANGELOG.md index 41cc7d81..60732342 100644 --- a/packages/stream_feeds/CHANGELOG.md +++ b/packages/stream_feeds/CHANGELOG.md @@ -1,3 +1,3 @@ -## 0.0.1 +## 0.1.0 -* TODO: Describe initial release. +* Initial release. diff --git a/packages/stream_feeds/pubspec.yaml b/packages/stream_feeds/pubspec.yaml index 9a370f88..2f348c5f 100644 --- a/packages/stream_feeds/pubspec.yaml +++ b/packages/stream_feeds/pubspec.yaml @@ -1,8 +1,7 @@ name: stream_feeds description: The official Dart client for Stream Feeds, a service for building applications with activity feeds. -version: 0.0.1 +version: 0.1.0 repository: https://github.com/GetStream/stream-feeds-flutter -publish_to: none # Delete when ready to publish # Note: The environment configuration and dependency versions are managed by Melos. # @@ -33,11 +32,7 @@ dependencies: retrofit: ^4.6.0 rxdart: ^0.28.0 state_notifier: ^1.0.0 - stream_core: - git: - url: https://github.com/GetStream/stream-core-flutter.git - ref: 280b1045e39388668fd060439259831611b51b5a - path: packages/stream_core + stream_core: ^0.1.0 uuid: ^4.5.1 dev_dependencies: diff --git a/packages/stream_feeds/test/client/feeds_client_impl_test.dart b/packages/stream_feeds/test/client/feeds_client_impl_test.dart new file mode 100644 index 00000000..c79587b8 --- /dev/null +++ b/packages/stream_feeds/test/client/feeds_client_impl_test.dart @@ -0,0 +1,17 @@ +import 'package:stream_feeds/src/client/feeds_client_impl.dart'; +import 'package:stream_feeds/stream_feeds.dart'; +import 'package:test/test.dart'; + +const testToken = + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoibHVrZV9za3l3YWxrZXIifQ.hZ59SWtp_zLKVV9ShkqkTsCGi_jdPHly7XNCf5T_Ev0'; +void main() { + test('Create a feeds client', () { + final client = StreamFeedsClient( + apiKey: 'apiKey', + user: const User(id: 'userId'), + tokenProvider: TokenProvider.static(UserToken(testToken)), + ); + + expect(client, isA()); + }); +} diff --git a/packages/stream_feeds/test/feeds_client_test.dart b/packages/stream_feeds/test/feeds_client_test.dart deleted file mode 100644 index 76aa8ab1..00000000 --- a/packages/stream_feeds/test/feeds_client_test.dart +++ /dev/null @@ -1,445 +0,0 @@ -// import 'dart:async'; -// import 'dart:convert'; -// -// import 'package:mocktail/mocktail.dart'; -// import 'package:stream_core/stream_core.dart'; -// import 'package:stream_feeds/src/generated/api/api.dart' as api; -// import 'package:stream_feeds/src/ws/feeds_ws_event.dart'; -// import 'package:stream_feeds/stream_feeds.dart'; -// import 'package:test/test.dart'; -// -// import 'mocks.dart'; -// -// void main() { -// setUpAll(() { -// registerFallbackValue(const WsAuthMessageRequest(token: 'test_token')); -// }); -// -// group('FeedsClient', () { -// const testApiKey = 'test_api_key'; -// const testUser = User(id: 'test_user_id', name: 'test_user_name'); -// const testUserToken = 'test_user_token'; -// -// group('constructor', () { -// test('should initialize with required parameters', () { -// final client = StreamFeedsClient( -// apiKey: testApiKey, -// user: testUser, -// tokenProvider: TokenProvider.dynamic( -// (userId) async => UserToken(testUserToken), -// ), -// ); -// -// expect(client.apiKey, equals(testApiKey)); -// expect(client.user, equals(testUser)); -// expect(client.config, isA()); -// expect(client.config.networkMonitor, isNull); -// }); -// -// test('should initialize with optional parameters', () { -// final client = FeedsClient( -// apiKey: testApiKey, -// user: testUser, -// userToken: testUserToken, -// ); -// -// expect(client.apiKey, equals(testApiKey)); -// expect(client.user, equals(testUser)); -// expect(client.config, isA()); -// }); -// }); -// -// group('feed', () { -// test('should create feed with correct query and client', () { -// final client = FeedsClient( -// apiKey: testApiKey, -// user: testUser, -// userToken: testUserToken, -// ); -// -// final query = FeedQuery(group: 'test_group', id: 'test_id'); -// final feed = client.feed(query: query); -// -// expect(feed.query, equals(query)); -// expect(feed.client, equals(client)); -// }); -// -// test('should create multiple feeds with different queries', () { -// final client = FeedsClient( -// apiKey: testApiKey, -// user: testUser, -// userToken: testUserToken, -// ); -// -// final query1 = FeedQuery(group: 'group1', id: 'id1'); -// final query2 = FeedQuery(group: 'group2', id: 'id2'); -// -// final feed1 = client.feed(query: query1); -// final feed2 = client.feed(query: query2); -// -// expect(feed1.query, equals(query1)); -// expect(feed2.query, equals(query2)); -// expect(feed1.client, equals(client)); -// expect(feed2.client, equals(client)); -// }); -// }); -// -// group('feedsRepository', () { -// test('should have initialized feedsRepository', () { -// final client = FeedsClient( -// apiKey: testApiKey, -// user: testUser, -// userToken: testUserToken, -// ); -// -// expect(client._feedsRepository, isNotNull); -// }); -// }); -// -// group('apiClient', () { -// test('should have initialized apiClient', () { -// final client = FeedsClient( -// apiKey: testApiKey, -// user: testUser, -// userToken: testUserToken, -// ); -// -// expect(client.apiClient, isNotNull); -// }); -// }); -// -// group('webSocketClient', () { -// test('should have initialized webSocketClient', () { -// final client = FeedsClient( -// apiKey: testApiKey, -// user: testUser, -// userToken: testUserToken, -// ); -// -// expect(client._webSocketClient, isNotNull); -// }); -// }); -// -// group('tokenManager', () { -// test('should have initialized tokenManager with static token', () { -// final client = FeedsClient( -// apiKey: testApiKey, -// user: testUser, -// userToken: testUserToken, -// ); -// -// expect(client._tokenManager, isNotNull); -// }); -// }); -// -// group('connectionRecoveryHandler', () { -// test('should be null initially', () { -// final client = FeedsClient( -// apiKey: testApiKey, -// user: testUser, -// userToken: testUserToken, -// ); -// -// expect(client.connectionRecoveryHandler, isNull); -// }); -// }); -// -// group('endpointConfig', () { -// test('should use production endpoint config', () { -// // Test that the endpoint config is accessible -// expect(FeedsClient.endpointConfig, isNotNull); -// }); -// }); -// -// group('feedsEvents', () { -// test('should return a stream', () { -// final client = FeedsClient( -// apiKey: testApiKey, -// user: testUser, -// userToken: testUserToken, -// ); -// -// expect(client.feedsEvents, isA>()); -// }); -// -// test('Should return a stream of FeedsWsEvent', () async { -// final client = FeedsClient( -// apiKey: testApiKey, -// user: testUser, -// userToken: testUserToken, -// ); -// -// final events = []; -// -// final eventsSubscription = client.feedsEvents.listen(events.add); -// -// // Health check events are kept internal -// client._webSocketClient.webSocketDidReceiveMessage( -// jsonEncode(testHealthCheckEvent.toJson()), -// ); -// -// // Feeds specific events are passed to `feedsEvents` -// client._webSocketClient.webSocketDidReceiveMessage( -// jsonEncode(testCommentAddedEvent.toJson()), -// ); -// -// await Future.delayed(Duration.zero); -// -// expect(events, hasLength(1)); -// expect(events[0], isA()); -// expect( -// (events[0] as FeedsWsEvent).apiEvent, -// isA(), -// ); -// -// await eventsSubscription.cancel(); -// }); -// }); -// group('connect', () { -// test('should connect to the websocket', () { -// final webSocketClient = MockWebSocketClient(); -// final connectionStateStream = -// MutableSharedEmitterImpl(); -// when(() => webSocketClient.connectionStateStream) -// .thenReturn(connectionStateStream); -// -// final client = FeedsClient( -// apiKey: testApiKey, -// user: testUser, -// userToken: testUserToken, -// environment: FakeFeedsClientEnvironment( -// webSocketClientBuilder: ({ -// required String url, -// required EventDecoder eventDecoder, -// PingReguestBuilder? pingReguestBuilder, -// VoidCallback? onConnectionEstablished, -// VoidCallback? onConnected, -// }) => -// webSocketClient, -// ), -// ); -// -// client.connect(); -// -// verify(webSocketClient.connect).called(1); -// }); -// -// test('connect Future should complete after connection', () async { -// final webSocketClient = MockWebSocketClient(); -// final connectionStateStream = -// MutableSharedEmitterImpl(); -// when(() => webSocketClient.connectionStateStream) -// .thenReturn(connectionStateStream); -// -// final client = FeedsClient( -// apiKey: testApiKey, -// user: testUser, -// userToken: testUserToken, -// environment: FakeFeedsClientEnvironment( -// webSocketClientBuilder: -// staticWebSocketClientBuilder(webSocketClient), -// ), -// ); -// -// final connectFuture = client.connect(); -// var isCompleted = false; -// unawaited(connectFuture.whenComplete(() => isCompleted = true)); -// await Future.delayed(Duration.zero); -// -// expect(isCompleted, isFalse); -// -// connectionStateStream.emit(WebSocketConnectionState.connected()); -// await Future.delayed(Duration.zero); -// expect(isCompleted, isTrue); -// }); -// -// test('Client should authenticate when connection established', () async { -// final webSocketClient = MockWebSocketClient(); -// final connectionStateStream = -// MutableSharedEmitterImpl(); -// when(() => webSocketClient.connectionStateStream) -// .thenReturn(connectionStateStream); -// -// late VoidCallback? onConnectionEstablishedCallback; -// -// final _ = FeedsClient( -// apiKey: testApiKey, -// user: testUser, -// userToken: testUserToken, -// environment: FakeFeedsClientEnvironment( -// webSocketClientBuilder: ({ -// required String url, -// required EventDecoder eventDecoder, -// PingReguestBuilder? pingReguestBuilder, -// VoidCallback? onConnectionEstablished, -// VoidCallback? onConnected, -// }) { -// onConnectionEstablishedCallback = onConnectionEstablished; -// return webSocketClient; -// }, -// ), -// ); -// -// onConnectionEstablishedCallback?.call(); -// await Future.delayed(Duration.zero); -// -// verify(() => webSocketClient.send(any())) -// .called(1); -// }); -// }); -// -// group('disconnect', () { -// test('dispose should disconnect websocket when connected', () { -// final webSocketClient = MockWebSocketClient(); -// final connectionStateStream = -// MutableSharedEmitterImpl(); -// -// final connectionState = WebSocketConnectionState.connected(); -// connectionStateStream.emit(connectionState); -// -// when(() => webSocketClient.connectionState).thenReturn(connectionState); -// when(() => webSocketClient.connectionStateStream) -// .thenReturn(connectionStateStream); -// -// final client = FeedsClient( -// apiKey: testApiKey, -// user: testUser, -// userToken: testUserToken, -// environment: FakeFeedsClientEnvironment( -// webSocketClientBuilder: -// staticWebSocketClientBuilder(webSocketClient), -// ), -// ); -// -// client.dispose(); -// -// verify(webSocketClient.disconnect).called(1); -// }); -// -// test('dispose should not disconnect websocket when disconnected', () { -// final webSocketClient = MockWebSocketClient(); -// final connectionStateStream = -// MutableSharedEmitterImpl(); -// -// final connectionState = -// Disconnected(source: DisconnectionSource.userInitiated()); -// connectionStateStream.emit(connectionState); -// -// when(() => webSocketClient.connectionState).thenReturn(connectionState); -// when(() => webSocketClient.connectionStateStream) -// .thenReturn(connectionStateStream); -// -// final client = FeedsClient( -// apiKey: testApiKey, -// user: testUser, -// userToken: testUserToken, -// environment: FakeFeedsClientEnvironment( -// webSocketClientBuilder: -// staticWebSocketClientBuilder(webSocketClient), -// ), -// ); -// -// client.dispose(); -// -// verifyNever(webSocketClient.disconnect); -// }); -// }); -// }); -// } -// -// final testHealthCheckEvent = api.HealthCheckEvent( -// connectionId: 'test-id', -// createdAt: DateTime.now(), -// custom: const {}, -// type: 'health.check', -// ); -// -// final testCommentAddedEvent = api.CommentAddedEvent( -// comment: api.CommentResponse( -// confidenceScore: 0, -// createdAt: DateTime.now(), -// downvoteCount: 0, -// id: 'test-id', -// mentionedUsers: const [], -// objectId: 'test-object-id', -// objectType: 'test-object-type', -// ownReactions: const [], -// reactionCount: 0, -// replyCount: 0, -// score: 0, -// status: 'active', -// updatedAt: DateTime.now(), -// upvoteCount: 0, -// user: testUserResponse, -// ), -// createdAt: DateTime.now(), -// custom: const {}, -// fid: 'test-fid', -// type: 'feeds.comment.added', -// ); -// -// final testUserResponse = api.UserResponse( -// id: 'test-user-id', -// banned: false, -// blockedUserIds: const [], -// createdAt: DateTime.now(), -// custom: const {}, -// language: '', -// online: false, -// role: '', -// teams: const [], -// updatedAt: DateTime.now(), -// ); -// -// FakeWebSocketClientBuilder staticWebSocketClientBuilder( -// WebSocketClient webSocketClient, -// ) { -// return ({ -// required String url, -// required EventDecoder eventDecoder, -// PingReguestBuilder? pingReguestBuilder, -// VoidCallback? onConnectionEstablished, -// VoidCallback? onConnected, -// }) => -// webSocketClient; -// } -// -// typedef FakeWebSocketClientBuilder = WebSocketClient Function({ -// required String url, -// required EventDecoder eventDecoder, -// PingReguestBuilder? pingReguestBuilder, -// VoidCallback? onConnectionEstablished, -// VoidCallback? onConnected, -// }); -// -// class FakeFeedsClientEnvironment extends FeedsClientEnvironment { -// FakeFeedsClientEnvironment({ -// this.webSocketClientBuilder, -// }); -// -// // websocket client builder -// FakeWebSocketClientBuilder? webSocketClientBuilder; -// -// @override -// WebSocketClient createWebSocketClient({ -// required String url, -// required EventDecoder eventDecoder, -// PingReguestBuilder? pingReguestBuilder, -// VoidCallback? onConnectionEstablished, -// VoidCallback? onConnected, -// }) => -// webSocketClientBuilder?.call( -// url: url, -// eventDecoder: eventDecoder, -// pingReguestBuilder: pingReguestBuilder, -// onConnectionEstablished: onConnectionEstablished, -// onConnected: onConnected, -// ) ?? -// super.createWebSocketClient( -// url: url, -// eventDecoder: eventDecoder, -// pingReguestBuilder: pingReguestBuilder, -// onConnectionEstablished: onConnectionEstablished, -// onConnected: onConnected, -// ); -// } diff --git a/packages/stream_feeds/test/mocks.dart b/packages/stream_feeds/test/mocks.dart index 21682e99..f5c089c2 100644 --- a/packages/stream_feeds/test/mocks.dart +++ b/packages/stream_feeds/test/mocks.dart @@ -1,33 +1,27 @@ -// import 'package:mocktail/mocktail.dart'; -// import 'package:stream_core/stream_core.dart'; -// import 'package:stream_feeds/src/repositories/feeds_repository.dart'; -// import 'package:stream_feeds/src/ws/feeds_ws_event.dart'; -// import 'package:stream_feeds/stream_feeds.dart'; -// -// class MockFeedsRepository extends Mock implements FeedsRepository {} -// -// class MockFeedsClient extends Mock implements FeedsClient {} -// -// class MockWebSocketClient extends Mock implements WebSocketClient {} -// -// class FakeFeedsClient extends Fake implements FeedsClient { -// FakeFeedsClient({ -// User? user, -// FeedsRepository? feedsRepository, -// }) : user = user ?? fakeUser, -// feedsRepository = feedsRepository ?? MockFeedsRepository(); -// -// @override -// final User user; -// -// @override -// final FeedsRepository feedsRepository; -// -// @override -// final Stream feedsEvents = const Stream.empty(); -// } -// -// const fakeUser = User( -// id: 'user_id', -// name: 'user_name', -// ); +import 'package:mocktail/mocktail.dart'; +import 'package:stream_feeds/src/client/feeds_client_impl.dart'; +import 'package:stream_feeds/src/repository/feeds_repository.dart'; +import 'package:stream_feeds/stream_feeds.dart'; + +class MockFeedsRepository extends Mock implements FeedsRepository {} + +class MockFeedsClient extends Mock implements StreamFeedsClient {} + +class MockWebSocketClient extends Mock implements StreamWebSocketClient {} + +class FakeFeedsClient extends Fake implements StreamFeedsClientImpl { + FakeFeedsClient({ + User? user, + }) : user = user ?? fakeUser; + + @override + final User user; + + @override + final EventEmitter events = MutableEventEmitter(); +} + +const fakeUser = User( + id: 'user_id', + name: 'user_name', +); diff --git a/packages/stream_feeds/test/models/activity_data_test.dart b/packages/stream_feeds/test/models/activity_data_test.dart deleted file mode 100644 index 49e8f499..00000000 --- a/packages/stream_feeds/test/models/activity_data_test.dart +++ /dev/null @@ -1,93 +0,0 @@ -// import 'package:stream_feeds/stream_feeds.dart'; -// import 'package:test/test.dart'; -// -// void main() { -// test( -// 'Add reaction to activityData should create a new instance with updated reaction count', -// () { -// final activityData = createActivityData(); -// -// final updatedActivityData = activityData.addReaction( -// FeedsReactionData( -// activityId: '1', -// type: 'like', -// user: const UserData(id: 'testUser'), -// createdAt: DateTime.now(), -// updatedAt: DateTime.now(), -// customData: const {}, -// ), -// currentUserId: 'testUser', -// ); -// -// expect(updatedActivityData.reactionCount, 1); -// expect(updatedActivityData, isNot(activityData)); -// }); -// -// test( -// 'Remove reaction from activityData should create a new instance with updated reaction count', -// () { -// final activityData = createActivityData( -// reactionCount: 2, -// latestReactions: [ -// FeedsReactionData( -// activityId: '1', -// type: 'like', -// user: const UserData(id: 'testUser'), -// createdAt: DateTime.now().subtract(const Duration(days: 1)), -// updatedAt: DateTime.now(), -// customData: const {}, -// ), -// FeedsReactionData( -// activityId: '1', -// type: 'like', -// user: const UserData(id: 'testUser2'), -// createdAt: DateTime.now(), -// updatedAt: DateTime.now(), -// customData: const {}, -// ), -// ], -// reactionGroups: { -// 'like': ReactionGroupData( -// count: 2, -// firstReactionAt: DateTime.now().subtract(const Duration(days: 7)), -// lastReactionAt: DateTime.now(), -// ), -// }, -// ); -// -// expect(activityData.reactionCount, 2); -// final updatedActivityData = activityData.removeReaction( -// FeedsReactionData( -// activityId: '1', -// type: 'like', -// user: const UserData(id: 'testUser'), -// createdAt: DateTime.now().subtract(const Duration(days: 1)), -// updatedAt: DateTime.now(), -// customData: const {}, -// ), -// currentUserId: 'testUser', -// ); -// -// expect(updatedActivityData.reactionCount, 1); -// expect(updatedActivityData, isNot(activityData)); -// }); -// } -// -// ActivityData createActivityData({ -// String? id, -// UserData? user, -// String? text, -// int? reactionCount, -// List? latestReactions, -// List? ownReactions, -// Map? reactionGroups, -// }) => -// ActivityData( -// id: id ?? '1', -// user: user ?? const UserData(id: 'testUser'), -// text: text ?? 'test message', -// reactionCount: reactionCount ?? 0, -// latestReactions: latestReactions ?? [], -// ownReactions: ownReactions ?? [], -// reactionGroups: reactionGroups ?? {}, -// ); diff --git a/packages/stream_feeds/test/state_layer/feed_test.dart b/packages/stream_feeds/test/state_layer/feed_test.dart deleted file mode 100644 index 542f3fb2..00000000 --- a/packages/stream_feeds/test/state_layer/feed_test.dart +++ /dev/null @@ -1,35 +0,0 @@ -// import 'package:mocktail/mocktail.dart'; -// import 'package:stream_feeds/stream_feeds.dart'; -// import 'package:test/test.dart'; -// -// import '../mocks.dart'; -// -// void main() { -// late MockFeedsRepository repository; -// -// setUp(() { -// repository = MockFeedsRepository(); -// }); -// -// test('Feed getOrCreate should call repository', () async { -// final query = FeedQuery(group: 'group', id: 'id'); -// const responseData = GetOrCreateFeedData( -// activities: PaginationResult( -// items: [], -// pagination: PaginationData(next: 'next', previous: 'previous'), -// ), -// ); -// -// when(() => repository.getOrCreateFeed(query)) -// .thenAnswer((_) async => responseData); -// -// final feed = Feed( -// query: query, -// client: FakeFeedsClient(feedsRepository: repository), -// ); -// await feed.getOrCreate(); -// -// verify(() => repository.getOrCreateFeed(feed.query)).called(1); -// expect(feed.stateNotifier.state.activities, responseData.activities.items); -// }); -// } diff --git a/pubspec.lock b/pubspec.lock index 169ec480..49a7a52b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -45,10 +45,10 @@ packages: dependency: transitive description: name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.0" charcode: dependency: transitive description: @@ -93,10 +93,10 @@ packages: dependency: transitive description: name: collection - sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" url: "https://pub.dev" source: hosted - version: "1.19.0" + version: "1.19.1" conventional_commit: dependency: transitive description: @@ -290,10 +290,10 @@ packages: dependency: transitive description: name: meta - sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.16.0" mime: dependency: transitive description: @@ -470,12 +470,11 @@ packages: stream_core: dependency: "direct main" description: - path: "packages/stream_core" - ref: "280b1045e39388668fd060439259831611b51b5a" - resolved-ref: "280b1045e39388668fd060439259831611b51b5a" - url: "https://github.com/GetStream/stream-core-flutter.git" - source: git - version: "0.0.1" + name: stream_core + sha256: "73238bd8e3f135cecf41292b8dfd2e683fd77df114ce26d7e77e2e7f6106e7e6" + url: "https://pub.dev" + source: hosted + version: "0.1.0" stream_feeds: dependency: "direct main" description: @@ -535,10 +534,10 @@ packages: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" web: dependency: transitive description: @@ -588,5 +587,5 @@ packages: source: hosted version: "2.2.2" sdks: - dart: ">=3.6.2 <4.0.0" + dart: ">=3.8.0-0 <4.0.0" flutter: ">=1.16.0" diff --git a/pubspec.yaml b/pubspec.yaml index d68427ac..7948aab0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,11 +5,7 @@ environment: dependencies: flutter_state_notifier: ^1.0.0 - stream_core: - git: - url: https://github.com/GetStream/stream-core-flutter.git - ref: 280b1045e39388668fd060439259831611b51b5a - path: packages/stream_core + stream_core: ^0.1.0 stream_feeds: path: ./packages/stream_feeds