Skip to content

Commit

Permalink
Merge pull request #1010 from GetStream/release/3.5.1
Browse files Browse the repository at this point in the history
chore(llc,core,ui): update pubspec and changelogs
  • Loading branch information
imtoori authored Mar 16, 2022
2 parents 18740a6 + 3620e57 commit b88967b
Show file tree
Hide file tree
Showing 15 changed files with 91 additions and 51 deletions.
6 changes: 6 additions & 0 deletions packages/stream_chat/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 3.5.1

🐞 Fixed
- `channel.unreadCount` was being set as using global unread count on a very specific case.
- The reconnection logic for the WebSocket connection is now more robust.

## 3.5.0

✅ Added
Expand Down
1 change: 0 additions & 1 deletion packages/stream_chat/lib/src/client/channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1902,7 +1902,6 @@ class ChannelClientState {
readList.add(Read(
user: event.user!,
lastRead: event.createdAt,
unreadMessages: event.totalUnreadCount ?? 0,
));
_channelState = _channelState.copyWith(read: readList);
}
Expand Down
14 changes: 11 additions & 3 deletions packages/stream_chat/lib/src/ws/websocket.dart
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,12 @@ class WebSocket with TimerHelper {
_connectionStatus = ConnectionStatus.connecting;
connectionCompleter = Completer<Event>();

final uri = await _buildUri();
_initWebSocketChannel(uri);
try {
final uri = await _buildUri();
_initWebSocketChannel(uri);
} catch (e, stk) {
_onConnectionError(e, stk);
}

return connectionCompleter!.future;
}
Expand All @@ -216,7 +220,11 @@ class WebSocket with TimerHelper {
Duration(milliseconds: delay),
() async {
final uri = await _buildUri(refreshToken: refreshToken);
_initWebSocketChannel(uri);
try {
_initWebSocketChannel(uri);
} catch (e, stk) {
_onConnectionError(e, stk);
}
},
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/stream_chat/lib/version.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '3.5.0';
const PACKAGE_VERSION = '3.5.1';
4 changes: 2 additions & 2 deletions packages/stream_chat/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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: 3.5.0
version: 3.5.1
repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues

Expand Down Expand Up @@ -30,5 +30,5 @@ dev_dependencies:
dart_code_metrics: ^4.4.0
freezed: ^1.0.0
json_serializable: ^6.0.1
mocktail: ^0.2.0
mocktail: ^0.3.0
test: ^1.17.12
7 changes: 7 additions & 0 deletions packages/stream_chat_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 3.5.1

🐞 Fixed

- Mentions overlay now doesn't overflow when there is not enough height available
- Updated `stream_chat_flutter_core` dependency to [`3.5.1`](https://pub.dev/packages/stream_chat_flutter_core/changelog).

## 3.5.0

🐞 Fixed
Expand Down
4 changes: 2 additions & 2 deletions packages/stream_chat_flutter/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 30
compileSdkVersion 31

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -41,7 +41,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.example"
minSdkVersion 21
targetSdkVersion 30
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:exported="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
Expand Down
2 changes: 1 addition & 1 deletion packages/stream_chat_flutter/example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.5.20'
ext.kotlin_version = '1.6.0'
repositories {
google()
jcenter()
Expand Down
9 changes: 6 additions & 3 deletions packages/stream_chat_flutter/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ dependencies:
cupertino_icons: ^1.0.3
flutter:
sdk: flutter
stream_chat_flutter: ^2.2.1
stream_chat_localizations: ^1.1.0
stream_chat_persistence: ^2.2.0
stream_chat_flutter:
path: ../
stream_chat_localizations:
path: ../../stream_chat_localizations
stream_chat_persistence:
path: ../../stream_chat_persistence

dev_dependencies:
flutter_test:
Expand Down
7 changes: 5 additions & 2 deletions packages/stream_chat_flutter/lib/src/media_list_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ class _MediaListViewState extends State<MediaListView> {
))
.firstOrNull;

final media = await assetList?.getAssetListPaged(_currentPage, 50);
final media = await assetList?.getAssetListPaged(
page: _currentPage,
size: 50,
);

if (media?.isNotEmpty == true) {
setState(() {
Expand Down Expand Up @@ -197,7 +200,7 @@ class MediaThumbnailProvider extends ImageProvider<MediaThumbnailProvider> {
DecoderCallback decode,
) async {
assert(key == this, 'Checks MediaThumbnailProvider');
final bytes = await media.thumbData;
final bytes = await media.thumbnailData;

return decode(bytes!);
}
Expand Down
65 changes: 37 additions & 28 deletions packages/stream_chat_flutter/lib/src/message_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ class MessageInputState extends State<MessageInput> {

final _imagePicker = ImagePicker();
late final _focusNode = widget.focusNode ?? FocusNode();
late final _isInternalFocusNode = widget.focusNode == null;
bool _inputEnabled = true;
bool _commandEnabled = false;
bool _showCommandsOverlay = false;
Expand Down Expand Up @@ -1191,30 +1192,36 @@ class MessageInputState extends State<MessageInput> {
};
}

return UserMentionsOverlay(
query: query,
mentionAllAppUsers: widget.mentionAllAppUsers,
client: StreamChat.of(context).client,
channel: channel,
size: Size(renderObject.size.width - 16, 400),
mentionsTileBuilder: tileBuilder,
onMentionUserTap: (user) {
_mentionedUsers.add(user);
splits[splits.length - 1] = user.name;
final rejoin = splits.join('@');

textEditingController.value = TextEditingValue(
text: rejoin +
textEditingController.text.substring(
textEditingController.selection.start,
),
selection: TextSelection.collapsed(
offset: rejoin.length,
),
);
_onChangedDebounced.cancel();
setState(() => _showMentionsOverlay = false);
},
return LayoutBuilder(
builder: (context, snapshot) => UserMentionsOverlay(
query: query,
mentionAllAppUsers: widget.mentionAllAppUsers,
client: StreamChat.of(context).client,
channel: channel,
size: Size(
renderObject.size.width - 16,
min(400, (snapshot.maxHeight - renderObject.size.height - 16).abs()),
),
mentionsTileBuilder: tileBuilder,
onMentionUserTap: (user) {
_mentionedUsers.add(user);
splits[splits.length - 1] = user.name;
final rejoin = splits.join('@');

textEditingController.value = TextEditingValue(
text: rejoin +
textEditingController.text.substring(
textEditingController.selection.start,
),
selection: TextSelection.collapsed(
offset: rejoin.length,
),
);
_onChangedDebounced.cancel();

setState(() => _showMentionsOverlay = false);
},
),
);
}

Expand Down Expand Up @@ -1925,6 +1932,7 @@ class MessageInputState extends State<MessageInput> {
void dispose() {
textEditingController.dispose();
_focusNode.removeListener(_focusNodeListener);
if (_isInternalFocusNode) _focusNode.dispose();
_stopSlowMode();
_onChangedDebounced.cancel();
super.dispose();
Expand Down Expand Up @@ -1970,27 +1978,28 @@ class _PickerWidget extends StatefulWidget {
}

class _PickerWidgetState extends State<_PickerWidget> {
Future<bool>? requestPermission;
Future<PermissionState>? requestPermission;

@override
void initState() {
super.initState();
requestPermission = PhotoManager.requestPermission();
requestPermission = PhotoManager.requestPermissionExtend();
}

@override
Widget build(BuildContext context) {
if (widget.filePickerIndex != 0) {
return const Offstage();
}
return FutureBuilder<bool>(
return FutureBuilder<PermissionState>(
future: requestPermission,
builder: (context, snapshot) {
if (!snapshot.hasData) {
return const Offstage();
}

if (snapshot.data!) {
if ([PermissionState.authorized, PermissionState.limited]
.contains(snapshot.data)) {
if (widget.containsFile) {
return GestureDetector(
onTap: () {
Expand Down
10 changes: 5 additions & 5 deletions packages/stream_chat_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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: 3.5.0
version: 3.5.1
repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues

Expand Down Expand Up @@ -31,12 +31,12 @@ dependencies:
lottie: ^1.0.1
meta: ^1.3.0
path_provider: ^2.0.1
photo_manager: ^1.2.6+1
photo_manager: ^2.0.1
photo_view: ^0.13.0
rxdart: ^0.27.0
share_plus: ^3.0.4
share_plus: ^4.0.1
shimmer: ^2.0.0
stream_chat_flutter_core: ^3.5.0
stream_chat_flutter_core: ^3.5.1
substring_highlight: ^1.0.26
synchronized: ^3.0.0
url_launcher: ^6.0.3
Expand All @@ -58,5 +58,5 @@ dev_dependencies:
flutter_test:
sdk: flutter
golden_toolkit: ^0.13.0
mocktail: ^0.2.0
mocktail: ^0.3.0
path: ^1.8.0
4 changes: 4 additions & 0 deletions packages/stream_chat_flutter_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.5.1

- Updated `stream_chat` dependency to [`3.5.1`](https://pub.dev/packages/stream_chat/changelog).

## 3.5.0

- Updated `stream_chat` dependency to [`3.5.0`](https://pub.dev/packages/stream_chat/changelog).
Expand Down
6 changes: 3 additions & 3 deletions packages/stream_chat_flutter_core/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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: 3.5.0
version: 3.5.1
repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues

Expand All @@ -16,12 +16,12 @@ dependencies:
sdk: flutter
meta: ^1.3.0
rxdart: ^0.27.0
stream_chat: ^3.5.0
stream_chat: ^3.5.1

dev_dependencies:
dart_code_metrics: ^4.4.0
fake_async: ^1.2.0
flutter_test:
sdk: flutter
mocktail: ^0.2.0
mocktail: ^0.3.0

0 comments on commit b88967b

Please sign in to comment.