Skip to content

chore: Bump min dart version 2.19 and dependenies #246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ linter:
- diagnostic_describe_all_properties
- empty_statements
- hash_and_equals
- invariant_booleans
- iterable_contains_unrelated_type
- list_remove_unrelated_type
- literal_only_boolean_expressions
Expand Down
7 changes: 4 additions & 3 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=2.19.0 <4.0.0"
flutter: ">=3.7.0"

dependencies:
cupertino_icons: ^1.0.2
cupertino_icons: ^1.0.5
flutter:
sdk: flutter
stream_feed:
path: ../packages/stream_feed
timeago: ^3.0.2
timeago: ^3.3.0

dev_dependencies:
flutter_test:
Expand Down
4 changes: 3 additions & 1 deletion packages/faye_dart/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## [0.1.1+3] - (20-02-2023)
- Bump Dart version and dependencies
## [0.1.1+2] - (27-05-2022)
- nothing new / lints

## [0.1.1+1] - (25-02-2022)

- fix: implement Equatable on `FayeClient`. With this change, if you fetch your client from an `InheritedWidget` for example, `updateShouldNotify` doesn't trigger every time.
Expand Down
19 changes: 9 additions & 10 deletions packages/faye_dart/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
name: faye_dart
description: Faye is a publish/subscribe messaging protocol that is built on the Bayeux protocol, a messaging system utilized for transporting asynchronous messages over HTTP.
version: 0.1.1+2
version: 0.1.1+3
homepage: https://github.com/GetStream/stream-feed-flutter/blob/master/packages/faye_dart
repository: https://github.com/GetStream/stream-feed-flutter/blob/master/packages/faye_dart
issue_tracker: https://github.com/GetStream/stream-feed-flutter/issues

environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=2.19.0 <4.0.0"

dependencies:
equatable: ^2.0.0
logging: ^1.0.1
meta: ^1.3.0
uuid: ^3.0.4
web_socket_channel: ^2.1.0
equatable: ^2.0.5
logging: ^1.1.1
meta: ^1.8.0
uuid: ^3.0.7
web_socket_channel: ^2.3.0

dev_dependencies:
mocktail: ^0.3.0
test: ^1.17.3

test: ^1.23.1
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# following page: https://dart.dev/tools/pub/pubspec
22 changes: 12 additions & 10 deletions packages/stream_feed/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 0.6.0+3: 20/02/2023
- Bump Dart version and dependencies
## 0.6.0+2: 27/05/2022
- bumb version in sdk header

Expand All @@ -23,11 +25,11 @@ await flatFeed.getPaginatedEnrichedActivities(limit: nextParams.limit,filter: ne

- fix: the `JsonConverter<DateTime,String>` implemented in 0.4.0+1 that was supposed to handle utc dates parsing wasn't working properly. Now that it is actually fixed you can convert dates in the user's local timezone.
- depedencies bumps

## 0.5.1: 12/01/2022

- upstream(realtime): version bump. You can now listen to connexion status in the `Subscription` class. For example:

```dart
final subscription = await feed.subscribe();
final subscriptionStatus = subscription.stateStream;
Expand All @@ -39,7 +41,7 @@ final subscriptionStatus = subscription.stateStream;
## 0.5.0: 12/01/2022

- BREAKING: we no longer accept a token in the constructor. This change is inspired by Stream Chat, and allows for use cases like multi account management. It allows to instantiate `StreamFeedClient` at the top of your widget tree for example, and connecting the user later.

```diff
- client = StreamFeedClient(apiKey, token: frontendToken);
+ client = StreamFeedClient(apiKey);
Expand Down Expand Up @@ -85,15 +87,15 @@ A = [actor]: can be an User, String
Ob = [object] can a String, or a CollectionEntry
T = [target] can be a String or an Activity
Or = [origin] can be a String or a Reaction or an User
- breaking: along with these changes we removed `EnrichableField` field from `EnrichedActivity`
- breaking: along with these changes we removed `EnrichableField` field from `EnrichedActivity`
- new: there is a type definition `EnrichedActivity` to handle most use cases of `GenericEnrichedActivity` (User,String,String,String)
- fix: a time drift issue in token generation when using the low level client sever-side
- bump: dart sdk package constraints to 2.14 to make use of typedefs for non function types


## 0.3.0: 06/09/2021

- improvements:
- improvements:
- docs
- better error handling and expose exeception type
- const constructors when possible
Expand All @@ -105,11 +107,11 @@ Or = [origin] can be a String or a Reaction or an User
- fix: missing field `ownChildren` in `Reaction` model
- new: allow sending enrichment flags in `filter` mehod
- new: createReactionReference

## 0.2.3: 03/08/2021

- remove dead links in Readmes

## 0.2.2: 14/06/2021

- fix: RealTime message serialization issue
Expand All @@ -122,12 +124,12 @@ RealtimeMessage newActivities field now of type `List<EnrichedActivity>` instead
## 0.2.0: 21/05/2021

- fix: Follow model
- new: FollowRelation
- new: FollowRelation
- breaking: un/followMany batch methods now accept `Iterable<FollowRelation>` parameter instead of `Iterable<Follow>`

## 0.1.3: 17/05/2021

- fix: EnrichedActivity Not Returning Reactions
- fix: EnrichedActivity Not Returning Reactions
- update links in readme

## 0.1.2: 07/05/2021
Expand All @@ -136,4 +138,4 @@ RealtimeMessage newActivities field now of type `List<EnrichedActivity>` instead

## 0.1.1: 07/05/2021

- first beta version
- first beta version
3 changes: 2 additions & 1 deletion packages/stream_feed/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ Future<void> main() async {
final like = await user1.addActivity(activity);

// send the update to the APIs
user1.updateActivityById(id: like.id!,
user1.updateActivityById(
id: like.id!,
// update the popularity value for the activity
set: {
'popularity': 10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class StreamFeedsDioError extends DioError {
required this.error,
required RequestOptions requestOptions,
Response? response,
DioErrorType type = DioErrorType.other,
DioErrorType type = DioErrorType.unknown,
}) : super(
error: error,
requestOptions: requestOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ class StreamFeedsNetworkError extends StreamFeedsError {
}
return StreamFeedsNetworkError.raw(
code: errorResponse?.code ?? -1,
message:
errorResponse?.message ?? response?.statusMessage ?? error.message,
message: errorResponse?.message ??
response?.statusMessage ??
error.message ??
'',
statusCode: errorResponse?.statusCode ?? response?.statusCode,
data: errorResponse,
)..stackTrace = error.stackTrace;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class LoggingInterceptor extends Interceptor {
@override
void onError(DioError err, ErrorInterceptorHandler handler) {
if (error) {
if (err.type == DioErrorType.response) {
if (err.type == DioErrorType.badResponse) {
final uri = err.response?.requestOptions.uri;
_printBoxed(
_logPrintError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class StreamHttpClient {
}) : options = options ?? const StreamHttpClientOptions(),
httpClient = dio ?? Dio() {
httpClient
..options.receiveTimeout = this.options.receiveTimeout.inMilliseconds
..options.connectTimeout = this.options.connectTimeout.inMilliseconds
..options.receiveTimeout = this.options.receiveTimeout
..options.connectTimeout = this.options.connectTimeout
..options.queryParameters = {
'api_key': apiKey,
'location': this.options.group,
Expand Down
30 changes: 15 additions & 15 deletions packages/stream_feed/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
name: stream_feed
description: Stream Feed official Dart SDK. Build your own feed experience using
Dart and Flutter.
version: 0.6.0+2
version: 0.6.0+3
repository: https://github.com/GetStream/stream-feed-flutter
issue_tracker: https://github.com/GetStream/stream-feed-flutter/issues
homepage: https://getstream.io/
environment:
sdk: ">=2.14.0 <3.0.0"
sdk: ">=2.19.0 <4.0.0"

dependencies:
collection: ^1.15.0
dio: ^4.0.0
equatable: ^2.0.0
faye_dart: ^0.1.1+2
http_parser: ^4.0.0
collection: ^1.17.0
dio: ^5.0.0
equatable: ^2.0.5
faye_dart: ^0.1.1+3
http_parser: ^4.0.2
intl: ^0.17.0
jose: ^0.3.2
json_annotation: ^4.4.0
logging: ^1.0.1
meta: ^1.3.0
mime: ^1.0.0
jose: ^0.3.3
json_annotation: ^4.8.0
logging: ^1.1.1
meta: ^1.8.0
mime: ^1.0.4

dev_dependencies:
build_runner: ^2.0.2
json_serializable: ^6.1.5
build_runner: ^2.3.3
json_serializable: ^6.6.1
mocktail: ^0.3.0
test: ^1.17.3
test: ^1.23.1
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
32 changes: 12 additions & 20 deletions packages/stream_feed/test/aggregated_client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ void main() {
};

final rawActivities = [jsonFixture('group.json')];
when(() => api.getEnrichedActivities(token, feedId, options))
.thenAnswer((_) async => Response(
when(() => api.getEnrichedActivities(token, feedId, options)).thenAnswer(
(_) async => Response(
data: {'results': rawActivities},
requestOptions: RequestOptions(
path: '',
),
requestOptions: RequestOptions(),
statusCode: 200));
final activities = await client.getEnrichedActivityDetail<String, String,
String, String>(activityId);
Expand Down Expand Up @@ -73,12 +71,10 @@ void main() {
...Default.marker.params,
};
final rawActivities = [jsonFixture('group.json')];
when(() => api.getActivities(token, feedId, options))
.thenAnswer((_) async => Response(
when(() => api.getActivities(token, feedId, options)).thenAnswer(
(_) async => Response(
data: {'results': rawActivities},
requestOptions: RequestOptions(
path: '',
),
requestOptions: RequestOptions(),
statusCode: 200));
final activities = await client.getActivityDetail(activityId);

Expand All @@ -105,12 +101,10 @@ void main() {
...marker.params,
};
final rawActivities = [jsonFixture('group.json')];
when(() => api.getActivities(token, feedId, options))
.thenAnswer((_) async => Response(
when(() => api.getActivities(token, feedId, options)).thenAnswer(
(_) async => Response(
data: {'results': rawActivities},
requestOptions: RequestOptions(
path: '',
),
requestOptions: RequestOptions(),
statusCode: 200));
final activities = await client.getActivities(
limit: limit, offset: offset, filter: filter, marker: marker);
Expand Down Expand Up @@ -141,12 +135,10 @@ void main() {
};

final rawActivities = [jsonFixture('group_enriched_activity.json')];
when(() => api.getEnrichedActivities(token, feedId, options))
.thenAnswer((_) async => Response(
when(() => api.getEnrichedActivities(token, feedId, options)).thenAnswer(
(_) async => Response(
data: {'results': rawActivities},
requestOptions: RequestOptions(
path: '',
),
requestOptions: RequestOptions(),
statusCode: 200));
final activities =
await client.getEnrichedActivities<String, String, String, String>(
Expand Down
4 changes: 2 additions & 2 deletions packages/stream_feed/test/analytics_api_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void main() {
data: json.encode([updatedImpression]),
)).thenAnswer(
(_) async => Response(
requestOptions: RequestOptions(path: ''),
requestOptions: RequestOptions(),
statusCode: 200,
),
);
Expand Down Expand Up @@ -100,7 +100,7 @@ void main() {
}),
)).thenAnswer(
(_) async => Response(
requestOptions: RequestOptions(path: ''),
requestOptions: RequestOptions(),
statusCode: 200,
),
);
Expand Down
4 changes: 2 additions & 2 deletions packages/stream_feed/test/analytics_client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void main() {
final updatedImpression = impression.copyWith(userData: userData);
when(() => api.trackImpressions(token, [updatedImpression])).thenAnswer(
(_) async => Response(
requestOptions: RequestOptions(path: ''),
requestOptions: RequestOptions(),
statusCode: 200,
),
);
Expand Down Expand Up @@ -89,7 +89,7 @@ void main() {
final updatedEngagement = engagement.copyWith(userData: userData);
when(() => api.trackEngagements(token, [updatedEngagement])).thenAnswer(
(_) async => Response(
requestOptions: RequestOptions(path: ''),
requestOptions: RequestOptions(),
statusCode: 200,
),
);
Expand Down
14 changes: 4 additions & 10 deletions packages/stream_feed/test/collections_client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,9 @@ void main() {
test('delete', () async {
const collection = 'food';
const entryId = 'cheeseburger';
when(() => api.delete(token, collection, entryId))
.thenAnswer((_) async => Response(
data: {},
requestOptions: RequestOptions(
path: '',
),
statusCode: 200));
when(() => api.delete(token, collection, entryId)).thenAnswer((_) async =>
Response(
data: {}, requestOptions: RequestOptions(), statusCode: 200));
await client.delete(collection, entryId);
verify(() => api.delete(token, collection, entryId)).called(1);
});
Expand Down Expand Up @@ -100,9 +96,7 @@ void main() {
when(() => api.deleteMany(token, collection, entryIds))
.thenAnswer((_) async => Response<Map>(
data: {}, //TODO: flaky
requestOptions: RequestOptions(
path: '',
),
requestOptions: RequestOptions(),
statusCode: 200));
await clientWithSecret.deleteMany(collection, entryIds);
verify(() => api.deleteMany(token, collection, entryIds)).called(1);
Expand Down
8 changes: 2 additions & 6 deletions packages/stream_feed/test/feed_client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ void main() {
final feedId = FeedId('slug', 'userId');
const token = Token('dummyToken');
final client = Feed(feedId, api, userToken: token);
final dummyResponse = Response(
data: {},
requestOptions: RequestOptions(
path: '',
),
statusCode: 200);
final dummyResponse =
Response(data: {}, requestOptions: RequestOptions(), statusCode: 200);

test('addActivity', () async {
const activity = Activity(
Expand Down
Loading