Merge branch 'develop' into cds-323

This commit is contained in:
groovinchip
2021-07-16 19:27:54 -04:00
76 changed files with 2771 additions and 82 deletions
+41 -11
View File
@@ -1,3 +1,44 @@
## 2.0.0
🛑️ Breaking Changes from `1.5.3`
- migrate this package to null safety
- `ConnectUserWithProvider` now requires `tokenProvider` as a required param. (Removed from the constructor)
- `client.disconnect()` is now divided into two different functions
- `client.closeConnection()` -> for closing user websocket connection.
- `client.disconnectUser()` -> for disconnecting user and resetting client state.
- `client.devToken()` now returns a `Token` model instead of `String`.
- `ApiError` is removed in favor of `StreamChatError`
- `StreamChatError` -> parent type for all the stream errors.
- `StreamWebSocketError` -> for user websocket related errors.
- `StreamChatNetworkError` -> for network related errors.
- `client.queryChannels()`, `channel.query()` options param is removed in favor of individual params
- `option.state` -> bool state
- `option.watch` -> bool watch
- `option.presence` -> bool presence
- `client.queryUsers()` options param is removed in favor of individual params
- `option.presence` -> bool presence
- Migrate this package to null safety
- Added typed filters
🐞 Fixed
- [#369](https://github.com/GetStream/stream-chat-flutter/issues/369): Client does not return without internet connection
- several minor fixes
- performance improvements
✅ Added
- New `Location` enum is introduced for easily changing the client location/baseUrl.
- New `client.openConnection()` and `client.closeConnection()` is introduced to connect/disconnect user ws connection.
- New `client.partialUpdateMessage` and `channel.partialUpdateMessage` methods
- `connectWebSocket` parameter in connect user calls to use the client in "connection-less" mode.
🔄 Changed
- `baseURL` is now deprecated in favor of using `Location` to change data location.
## 2.0.0-nullsafety.8
🐞 Fixed
@@ -32,21 +73,10 @@
- `baseURL` is now deprecated in favor of using `Location` to change data location.
🐞 Fixed
- [#369](https://github.com/GetStream/stream-chat-flutter/issues/369): Client does not return without internet
connection
## 2.0.0-nullsafety.6
- Fix thread reply not working with attachments
- Minor fixes
## 2.0.0-nullsafety.6
- Fix thread reply not working with attachments
- Minor fixes
## 2.0.0-nullsafety.5
- Minor fixes
@@ -426,7 +426,10 @@ class StreamChatClient {
await queryChannelsOnline(
filter: Filter.in_('cid', cids),
paginationParams: const PaginationParams(limit: 30),
).then((_) => sync(cids: cids, lastSyncAt: _lastSyncedAt));
);
if (persistenceEnabled) {
await sync(cids: cids, lastSyncAt: _lastSyncedAt);
}
}
handleEvent(Event(
type: EventType.connectionRecovered,
+1 -1
View File
@@ -3,4 +3,4 @@ import 'package:stream_chat/src/client/client.dart';
/// Current package version
/// Used in [StreamChatClient] to build the `x-stream-client` header
// ignore: constant_identifier_names
const PACKAGE_VERSION = '2.0.0-nullsafety.8';
const PACKAGE_VERSION = '2.0.0';
+1 -1
View File
@@ -1,7 +1,7 @@
name: stream_chat
homepage: https://getstream.io/
description: The official Dart client for Stream Chat, a service for building chat applications.
version: 2.0.0-nullsafety.8
version: 2.0.0
repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
+64
View File
@@ -1,3 +1,67 @@
## 2.0.0
🛑️ Breaking Changes from `1.5.4`
- Migrate this package to null safety
- Renamed `ChannelImage` to `ChannelAvatar`
- Updated `StreamChatThemeData.reactionIcons` to accept custom builder
- Renamed `ColorTheme` properties to reflect the purpose of the colors
- `ColorTheme.black` -> `ColorTheme.textHighEmphasis`
- `ColorTheme.grey` -> `ColorTheme.textLowEmphasis`
- `ColorTheme.greyGainsboro` -> `ColorTheme.disabled`
- `ColorTheme.greyWhisper` -> `ColorTheme.borders`
- `ColorTheme.whiteSmoke` -> `ColorTheme.inputBg`
- `ColorTheme.whiteSnow` -> `ColorTheme.appBg`
- `ColorTheme.white` -> `ColorTheme.barsBg`
- `ColorTheme.blueAlice` -> `ColorTheme.linkBg`
- `ColorTheme.accentBlue` -> `ColorTheme.accentPrimary`
- `ColorTheme.accentRed` -> `ColorTheme.accentError`
- `ColorTheme.accentGreen` -> `ColorTheme.accentInfo`
- `ChannelListCore` options property is removed in favor of individual properties
- `options.state` -> bool state
- `options.watch` -> bool watch
- `options.presence` -> bool presence
- `UserListView` options property is removed in favor of individual properties
- `options.presence` -> bool presence
- Renamed `ImageHeader` to `GalleryHeader`
- Renamed `ImageFooter` to `GalleryFooter`
- `MessageBuilder` and `ParentMessageBuilder` signature is now
```dart
typedef MessageBuilder = Widget Function(
BuildContext,
MessageDetails,
List<Message>,
MessageWidget defaultMessageWidget,
);
```
the last parameter is the default `MessageWidget`
You can call `.copyWith` to customize just a subset of properties
✅ Added
- Added video compress options (frame and quality) to `MessageInput`
- TypingIndicator now has a property called `parentId` to show typing indicator specific to threads
- [#493](https://github.com/GetStream/stream-chat-flutter/pull/493): add support for messageListView header/footer
- `MessageWidget` accepts a `userAvatarBuilder`
- Added pinMessage ui support
- Added `MessageListView.threadSeparatorBuilder` property
- Added `MessageInput.onError` property to allow error handling
- Added `GalleryHeader/GalleryFooter` theme classes
🐞 Fixed
- [#483](https://github.com/GetStream/stream-chat-flutter/issues/483): Keyboard covers input text box when editing
message
- Modals are shown using the nearest `Navigator` to make using the SDK easier in a nested navigator use case
- [#484](https://github.com/GetStream/stream-chat-flutter/issues/484): messages don't update without a reload
- `MessageListView` not rendering if the user is not a member of the channel
- Fix `MessageInput` overflow when there are no actions
- Minor fixes and improvements
## 2.0.0-nullsafety.9
🛑️ Breaking Changes from `2.0.0-nullsafety.8`
+1 -1
View File
@@ -28,7 +28,7 @@ It teaches you how to use this SDK and also shows how to make frequently require
## Example App
This repo includes a fully functional example app with setup instructions.
The example is available under the [example](https://github.com/GetStream/stream-chat-flutter/tree/master/example) folder.
The example is available under the [example](https://github.com/GetStream/stream-chat-flutter/tree/master/packages/stream_chat_flutter/example) folder.
## Add dependency
Add this to your package's pubspec.yaml file, use the latest version [![Pub](https://img.shields.io/pub/v/stream_chat_flutter.svg)](https://pub.dartlang.org/packages/stream_chat_flutter)
+2 -2
View File
@@ -1,7 +1,7 @@
name: stream_chat_flutter
homepage: https://github.com/GetStream/stream-chat-flutter
description: Stream Chat official Flutter SDK. Build your own chat experience using Dart and Flutter.
version: 2.0.0-nullsafety.9
version: 2.0.0
repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
@@ -36,7 +36,7 @@ dependencies:
scrollable_positioned_list: ^0.2.0-nullsafety.0
share_plus: ^2.0.3
shimmer: ^2.0.0
stream_chat_flutter_core: ^2.0.0-nullsafety.9
stream_chat_flutter_core: ^2.0.0
substring_highlight: ^1.0.26
synchronized: ^3.0.0
url_launcher: ^6.0.3
@@ -1,3 +1,24 @@
## 2.0.0
🛑️ Breaking Changes from `1.5.3`
- migrate this package to null safety
- `channelsBloc.queryChannels()`, `ChannelListCore` options param/property is removed in favor of individual params/properties
- `options.state` -> bool state
- `options.watch` -> bool watch
- `options.presence` -> bool presence
- `usersBloc.queryUsers()`, `UserListCore` options param/property is removed in favor of individual params/properties
- `options.presence` -> bool presence
✅ Added
- Monitor connection using `connectivity_plus` package
🐞 Fixed
- Minor fixes
- Performance improvements
## 2.0.0-nullsafety.9
- Update llc dependency
+1 -1
View File
@@ -28,7 +28,7 @@ This repo includes a fully functional example app with setup instructions.
The example is available under the [example](https://github.com/GetStream/stream-chat-flutter-core/tree/master/example) folder.
## Add dependency
Add this to your package's pubspec.yaml file, use the latest version [![Pub](https://img.shields.io/pub/v/stream_chat_flutter.svg)](https://pub.dartlang.org/packages/stream_chat_flutter)
Add this to your package's pubspec.yaml file, use the latest version [![Pub](https://img.shields.io/pub/v/stream_chat_flutter_core.svg)](https://pub.dartlang.org/packages/stream_chat_flutter_core)
```yaml
dependencies:
stream_chat_flutter_core: ^latest_version
@@ -19,16 +19,15 @@ import 'package:stream_chat_flutter_core/src/typedef.dart';
/// Widget build(BuildContext context) {
/// return Scaffold(
/// body: ChannelListCore(
/// filter: {
/// 'members': {
/// '\$in': [StreamChat.of(context).user.id],
/// }
/// },
/// filter: Filter.in_(
/// 'members',
/// [StreamChat.of(context).user!.id],
/// ),
/// sort: [SortOption('last_message_at')],
/// pagination: PaginationParams(
/// limit: 20,
/// ),
/// errorBuilder: (err) {
/// errorBuilder: (context, err) {
/// return Center(
/// child: Text('An error has occured'),
/// );
@@ -38,7 +37,7 @@ import 'package:stream_chat_flutter_core/src/typedef.dart';
/// child: Text('Nothing here...'),
/// );
/// },
/// emptyBuilder: (context) {
/// loadingBuilder: (context) {
/// return Center(
/// child: CircularProgressIndicator(),
/// );
@@ -17,12 +17,8 @@ import 'package:stream_chat_flutter_core/src/typedef.dart';
/// Widget build(BuildContext context) {
/// return Scaffold(
/// body: MessageSearchListCore(
/// messageQuery: _channelQuery,
/// filters: {
/// 'members': {
/// r'$in': [user.id]
/// }
/// },
/// messageQuery: _messageFilter,
/// filters: _channelsFilter,
/// paginationParams: PaginationParams(limit: 20),
/// ),
/// );
@@ -1,7 +1,7 @@
name: stream_chat_flutter_core
homepage: https://github.com/GetStream/stream-chat-flutter
description: Stream Chat official Flutter SDK Core. Build your own chat experience using Dart and Flutter.
version: 2.0.0-nullsafety.9
version: 2.0.0
repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
@@ -16,7 +16,7 @@ dependencies:
sdk: flutter
meta: ^1.3.0
rxdart: ^0.27.0
stream_chat: ^2.0.0-nullsafety.8
stream_chat: ^2.0.0
dev_dependencies:
fake_async: ^1.2.0
@@ -296,15 +296,15 @@ void main() {
await tester.runAsync(() async {
final mockClient = MockClient();
final mockOnBackgroundEventReceived = MockOnBackgroundEventReceived();
const backgroundKeepAlive = const Duration(seconds: 3);
const backgroundKeepAlive = Duration(seconds: 3);
const streamChatCoreKey = Key('streamChatCore');
const childKey = Key('child');
final streamChatCore = StreamChatCore(
key: streamChatCoreKey,
client: mockClient,
child: Offstage(key: childKey),
onBackgroundEventReceived: mockOnBackgroundEventReceived,
backgroundKeepAlive: backgroundKeepAlive,
child: const Offstage(key: childKey),
);
await tester.pumpWidget(streamChatCore);
@@ -313,12 +313,13 @@ void main() {
expect(find.byKey(childKey), findsOneWidget);
final event = Event(type: EventType.any);
when(() => mockClient.on()).thenAnswer((_) => Stream.value(event));
when(mockClient.on).thenAnswer((_) => Stream.value(event));
final streamChatCoreState = tester.state<StreamChatCoreState>(
find.byKey(streamChatCoreKey),
);
// ignore: cascade_invocations
streamChatCoreState
.didChangeAppLifecycleState(AppLifecycleState.paused);
@@ -346,8 +347,8 @@ void main() {
final streamChatCore = StreamChatCore(
key: streamChatCoreKey,
client: mockClient,
child: Offstage(key: childKey),
connectivityStream: Stream.value(ConnectivityResult.mobile),
child: const Offstage(key: childKey),
);
await tester.pumpWidget(streamChatCore);
@@ -356,10 +357,10 @@ void main() {
expect(find.byKey(childKey), findsOneWidget);
final event = Event(type: EventType.any);
when(() => mockClient.on()).thenAnswer((_) => Stream.value(event));
when(() => mockClient.openConnection())
when(mockClient.on).thenAnswer((_) => Stream.value(event));
when(mockClient.openConnection)
.thenAnswer((_) async => OwnUser(id: 'test'));
when(() => mockClient.closeConnection()).thenAnswer((_) async => null);
when(mockClient.closeConnection).thenAnswer((_) async {});
when(() => mockClient.wsConnectionStatus)
.thenReturn(ConnectionStatus.disconnected);
@@ -367,6 +368,7 @@ void main() {
find.byKey(streamChatCoreKey),
);
// ignore: cascade_invocations
streamChatCoreState
.didChangeAppLifecycleState(AppLifecycleState.paused);
@@ -375,7 +377,7 @@ void main() {
streamChatCoreState
.didChangeAppLifecycleState(AppLifecycleState.inactive);
verify(() => mockClient.openConnection()).called(1);
verify(mockClient.openConnection).called(1);
});
},
);
@@ -391,18 +393,18 @@ void main() {
const childKey = Key('child');
final event = Event();
when(() => mockClient.on()).thenAnswer((_) => Stream.value(event));
when(() => mockClient.openConnection())
when(mockClient.on).thenAnswer((_) => Stream.value(event));
when(mockClient.openConnection)
.thenAnswer((_) async => OwnUser(id: 'test'));
when(() => mockClient.closeConnection()).thenAnswer((_) async => null);
when(mockClient.closeConnection).thenAnswer((_) async {});
when(() => mockClient.wsConnectionStatus)
.thenReturn(ConnectionStatus.disconnected);
final streamChatCore = StreamChatCore(
key: streamChatCoreKey,
client: mockClient,
child: Offstage(key: childKey),
connectivityStream: Stream.value(ConnectivityResult.none),
child: const Offstage(key: childKey),
);
await tester.pumpWidget(streamChatCore);
@@ -414,6 +416,7 @@ void main() {
find.byKey(streamChatCoreKey),
);
// ignore: cascade_invocations
streamChatCoreState
.didChangeAppLifecycleState(AppLifecycleState.paused);
@@ -422,7 +425,7 @@ void main() {
streamChatCoreState
.didChangeAppLifecycleState(AppLifecycleState.inactive);
verifyNever(() => mockClient.openConnection());
verifyNever(mockClient.openConnection);
});
},
);
@@ -1,3 +1,7 @@
## 2.0.0
* Migrate this package to null safety
* Minor fixes and improvements
## 2.0.0-nullsafety.8
* Updated llc dependency
* Upgraded moor dependencies and generated files with the latest dependency
@@ -1,7 +1,7 @@
name: stream_chat_persistence
homepage: https://github.com/GetStream/stream-chat-flutter
description: Official Stream Chat Persistence library. Build your own chat experience using Dart and Flutter.
version: 2.0.0-nullsafety.8
version: 2.0.0
repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
@@ -18,7 +18,7 @@ dependencies:
path: ^1.8.0
path_provider: ^2.0.1
sqlite3_flutter_libs: ^0.5.0
stream_chat: ^2.0.0-nullsafety.8
stream_chat: ^2.0.0
dev_dependencies:
build_runner: ^2.0.1