Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
imtoori committed May 3, 2022
2 parents 3e512c8 + 9204a62 commit 5f0a309
Show file tree
Hide file tree
Showing 22 changed files with 150 additions and 125 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dart_code_metrics.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Dart Code Metrics

env:
flutter_version: "2.8.1"
flutter_version: "2.10.5"
folders: "lib, test"
melos_version: "1.2.0"
melos_version: "2.1.0"

on:
pull_request:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stream_flutter_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: stream_flutter_workflow

env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
flutter_version: "2.8.1"
melos_version: "1.2.0"
flutter_version: "2.10.5"
melos_version: "2.1.0"

on:
pull_request:
Expand Down
6 changes: 3 additions & 3 deletions docusaurus/docs/Flutter/guides/migration_guide_4_0.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: migration_guide_4_0
sidebar_position: 14
title: Migration Guide For The Stream Chat Flutter SDK v4.0
title: Migration Guide v4.0
---

**Version 4.0.0** of the Stream Chat Flutter SDK carries significant architectural changes to improve the developer experience by giving you more control and flexibility in how you use our core components and UI widgets.
Expand Down Expand Up @@ -44,7 +44,7 @@ See the sections below on “deprecated classes” for a complete list of change

This section highlights functionality removed.

## Removed methods and classes
### Removed Methods And Classes

In version 4 we removed the following deprecated methods and classes:

Expand Down Expand Up @@ -733,7 +733,7 @@ The controller makes it much simpler to dynamically modify the message input.

## Stream Chat Flutter Core

Various changes have been made to the Core package, most notably, the indroduction of all of the controllers mentioned above:
Various changes have been made to the Core package, most notably, the indroduction of all of the controllers mentioned above.

These controllers replace the business logic implementations (Bloc). Please note that this is not related to the well-known Flutter Bloc package, but instead refers to the naming we used for our business logic components.

Expand Down
6 changes: 6 additions & 0 deletions packages/stream_chat/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## 4.0.1

- Minor fixes

## 4.0.0

For upgrading to V4, please refer to the [V4 Migration Guide](https://getstream.io/chat/docs/sdk/flutter/guides/migration_guide_4_0/)

✅ Added

- Added `push_provider_name` to `addDevice` API call
Expand Down
4 changes: 4 additions & 0 deletions packages/stream_chat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
- [Chat UI Kit](https://getstream.io/chat/ui-kit/)
- [Chat Client Docs](https://getstream.io/chat/docs/flutter-dart/?language=dart)

**V4 Migration Guide**

For upgrading from V3 to V4, please refer to the [V4 Migration Guide](https://getstream.io/chat/docs/sdk/flutter/guides/migration_guide_4_0/)

### Changelog

Check out the [changelog on pub.dev](https://pub.dev/packages/stream_chat/changelog) to see the latest changes in the package.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ part of 'attachment_file.dart';
T _$identity<T>(T value) => value;

final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods');

UploadState _$UploadStateFromJson(Map<String, dynamic> json) {
switch (json['runtimeType']) {
Expand All @@ -31,39 +31,6 @@ UploadState _$UploadStateFromJson(Map<String, dynamic> json) {
}
}

/// @nodoc
class _$UploadStateTearOff {
const _$UploadStateTearOff();

Preparing preparing() {
return const Preparing();
}

InProgress inProgress({required int uploaded, required int total}) {
return InProgress(
uploaded: uploaded,
total: total,
);
}

Success success() {
return const Success();
}

Failed failed({required String error}) {
return Failed(
error: error,
);
}

UploadState fromJson(Map<String, Object?> json) {
return UploadState.fromJson(json);
}
}

/// @nodoc
const $UploadState = _$UploadStateTearOff();

/// @nodoc
mixin _$UploadState {
@optionalTypeArgs
Expand Down Expand Up @@ -154,7 +121,7 @@ class _$PreparingCopyWithImpl<$Res> extends _$UploadStateCopyWithImpl<$Res>
/// @nodoc
@JsonSerializable()
class _$Preparing implements Preparing {
const _$Preparing({String? $type}) : $type = $type ?? 'preparing';
const _$Preparing({final String? $type}) : $type = $type ?? 'preparing';

factory _$Preparing.fromJson(Map<String, dynamic> json) =>
_$$PreparingFromJson(json);
Expand All @@ -173,6 +140,7 @@ class _$Preparing implements Preparing {
(other.runtimeType == runtimeType && other is Preparing);
}

@JsonKey(ignore: true)
@override
int get hashCode => runtimeType.hashCode;

Expand Down Expand Up @@ -301,7 +269,7 @@ class _$InProgressCopyWithImpl<$Res> extends _$UploadStateCopyWithImpl<$Res>
@JsonSerializable()
class _$InProgress implements InProgress {
const _$InProgress(
{required this.uploaded, required this.total, String? $type})
{required this.uploaded, required this.total, final String? $type})
: $type = $type ?? 'inProgress';

factory _$InProgress.fromJson(Map<String, dynamic> json) =>
Expand Down Expand Up @@ -329,6 +297,7 @@ class _$InProgress implements InProgress {
const DeepCollectionEquality().equals(other.total, total));
}

@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(
runtimeType,
Expand Down Expand Up @@ -421,14 +390,14 @@ class _$InProgress implements InProgress {
}

abstract class InProgress implements UploadState {
const factory InProgress({required int uploaded, required int total}) =
_$InProgress;
const factory InProgress(
{required final int uploaded, required final int total}) = _$InProgress;

factory InProgress.fromJson(Map<String, dynamic> json) =
_$InProgress.fromJson;

int get uploaded;
int get total;
int get uploaded => throw _privateConstructorUsedError;
int get total => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$InProgressCopyWith<InProgress> get copyWith =>
throw _privateConstructorUsedError;
Expand All @@ -453,7 +422,7 @@ class _$SuccessCopyWithImpl<$Res> extends _$UploadStateCopyWithImpl<$Res>
/// @nodoc
@JsonSerializable()
class _$Success implements Success {
const _$Success({String? $type}) : $type = $type ?? 'success';
const _$Success({final String? $type}) : $type = $type ?? 'success';

factory _$Success.fromJson(Map<String, dynamic> json) =>
_$$SuccessFromJson(json);
Expand All @@ -472,6 +441,7 @@ class _$Success implements Success {
(other.runtimeType == runtimeType && other is Success);
}

@JsonKey(ignore: true)
@override
int get hashCode => runtimeType.hashCode;

Expand Down Expand Up @@ -593,7 +563,7 @@ class _$FailedCopyWithImpl<$Res> extends _$UploadStateCopyWithImpl<$Res>
/// @nodoc
@JsonSerializable()
class _$Failed implements Failed {
const _$Failed({required this.error, String? $type})
const _$Failed({required this.error, final String? $type})
: $type = $type ?? 'failed';

factory _$Failed.fromJson(Map<String, dynamic> json) =>
Expand All @@ -618,6 +588,7 @@ class _$Failed implements Failed {
const DeepCollectionEquality().equals(other.error, error));
}

@JsonKey(ignore: true)
@override
int get hashCode =>
Object.hash(runtimeType, const DeepCollectionEquality().hash(error));
Expand Down Expand Up @@ -708,11 +679,11 @@ class _$Failed implements Failed {
}

abstract class Failed implements UploadState {
const factory Failed({required String error}) = _$Failed;
const factory Failed({required final String error}) = _$Failed;

factory Failed.fromJson(Map<String, dynamic> json) = _$Failed.fromJson;

String get error;
String get error => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$FailedCopyWith<Failed> get copyWith => throw _privateConstructorUsedError;
}
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 = '4.0.0';
const PACKAGE_VERSION = '4.0.1';
2 changes: 1 addition & 1 deletion 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: 4.0.0
version: 4.0.1
repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues

Expand Down
8 changes: 8 additions & 0 deletions packages/stream_chat_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## 4.0.1

- Minor fixes
- Updated `stream_chat_flutter_core` dependency to [`4.0.1`](https://pub.dev/packages/stream_chat_flutter_core/changelog).

## 4.0.0

For upgrading to V4, please refer to the [V4 Migration Guide](https://getstream.io/chat/docs/sdk/flutter/guides/migration_guide_4_0/)

✅ Added

- [[#1087]](https://github.com/GetStream/stream-chat-flutter/issues/1087): Handle limited access to camera on iOS.
Expand All @@ -11,6 +18,7 @@
- [[#842]](https://github.com/GetStream/stream-chat-flutter/issues/842): show date divider for first message.
- Loosen up url check for attachment download.
- Use `ogScrapeUrl` for LinkAttachments.

## 4.0.0-beta.2

✅ Added
Expand Down
20 changes: 10 additions & 10 deletions packages/stream_chat_flutter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
- [UI Docs](https://getstream.io/chat/docs/sdk/flutter/stream_chat_flutter/introduction/)
- [Chat Client Docs](https://getstream.io/chat/docs/flutter-dart/?language=dart)

**V4 Migration Guide**

For upgrading from V3 to V4, please refer to the [V4 Migration Guide](https://getstream.io/chat/docs/sdk/flutter/guides/migration_guide_4_0/)

### Changelog

Check out the [changelog on pub.dev](https://pub.dev/packages/stream_chat_flutter/changelog) to see the latest changes in the package.
Expand Down Expand Up @@ -71,16 +75,12 @@ If you require the maximum amount of control over the API, please use the low le
These are the available Widgets that you can use to build your application UI.
Every widget uses the `StreamChat` or `StreamChannel` widgets to manage the state and communicate with Stream services.

- [StreamChannelHeader](https://pub.dev/documentation/stream_chat_flutter/latest/stream_chat_flutter/StreamChannelHeader-class.html)
- [StreamChannelAvatar](https://pub.dev/documentation/stream_chat_flutter/latest/stream_chat_flutter/StreamChannelAvatar-class.html)
- [StreamChannelListView](https://pub.dev/documentation/stream_chat_flutter/latest/stream_chat_flutter/StreamChannelListView-class.html)
- [StreamChannelName](https://pub.dev/documentation/stream_chat_flutter/latest/stream_chat_flutter/StreamChannelName-class.html)
- [StreamChannelListTile](https://pub.dev/documentation/stream_chat_flutter/latest/stream_chat_flutter/StreamChannelListTile-class.html)
- [StreamMessageInput](https://pub.dev/documentation/stream_chat_flutter/latest/stream_chat_flutter/StreamMessageInput-class.html)
- [StreamMessageListView](https://pub.dev/documentation/stream_chat_flutter/latest/stream_chat_flutter/StreamMessageListView-class.html)
- [StreamMessageWidget](https://pub.dev/documentation/stream_chat_flutter/latest/stream_chat_flutter/StreamMessageWidget-class.html)
- [StreamChatTheme](https://pub.dev/documentation/stream_chat_flutter/latest/stream_chat_flutter/StreamChatTheme-class.html)
- [StreamThreadHeader](https://pub.dev/documentation/stream_chat_flutter/latest/stream_chat_flutter/StreamThreadHeader-class.html)
- [StreamChannelHeader](https://getstream.io/chat/docs/sdk/flutter/stream_chat_flutter/stream_channel_header/)
- [StreamChannelListView](https://getstream.io/chat/docs/sdk/flutter/stream_chat_flutter/stream_channel_list_view/)
- [StreamMessageInput](https://getstream.io/chat/docs/sdk/flutter/stream_chat_flutter/stream_message_input/)
- [StreamMessageListView](https://getstream.io/chat/docs/sdk/flutter/stream_chat_flutter/stream_message_list_view/)
- [StreamMessageWidget](https://getstream.io/chat/docs/sdk/flutter/stream_chat_flutter/stream_message_widget/)
- [StreamChatTheme](https://getstream.io/chat/docs/sdk/flutter/stream_chat_flutter/stream_chat_and_theming/)
- ...

### Customizing styles
Expand Down
10 changes: 6 additions & 4 deletions packages/stream_chat_flutter/lib/src/info_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ class StreamInfoTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
final chatThemeData = StreamChatTheme.of(context);
return PortalEntry(
return PortalTarget(
visible: showMessage,
portalAnchor: tileAnchor ?? Alignment.topCenter,
childAnchor: childAnchor ?? Alignment.bottomCenter,
portal: Container(
anchor: Aligned(
follower: tileAnchor ?? Alignment.topCenter,
target: childAnchor ?? Alignment.bottomCenter,
),
portalFollower: Container(
height: 25,
color: backgroundColor ??
chatThemeData.colorTheme.textLowEmphasis.withOpacity(0.9),
Expand Down
18 changes: 12 additions & 6 deletions packages/stream_chat_flutter/lib/src/message_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -659,9 +659,9 @@ class _StreamMessageWidgetState extends State<StreamMessageWidget>
if (widget.showUserAvatar == DisplayWidget.hide)
SizedBox(width: avatarWidth + 4),
Flexible(
child: PortalEntry(
child: PortalTarget(
visible: showReactions,
portal: showReactions
portalFollower: showReactions
? Container(
transform:
Matrix4.translationValues(
Expand All @@ -677,10 +677,16 @@ class _StreamMessageWidgetState extends State<StreamMessageWidget>
),
)
: null,
portalAnchor:
Alignment(widget.reverse ? 1 : -1, -1),
childAnchor:
Alignment(widget.reverse ? -1 : 1, -1),
anchor: Aligned(
follower: Alignment(
widget.reverse ? 1 : -1,
-1,
),
target: Alignment(
widget.reverse ? -1 : 1,
-1,
),
),
child: Stack(
clipBehavior: Clip.none,
children: [
Expand Down
10 changes: 6 additions & 4 deletions packages/stream_chat_flutter/lib/src/multi_overlay.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ class StreamMultiOverlay extends StatelessWidget {
final visibleOverlay =
overlayOptions.firstWhereOrNull((element) => element.visible);

return PortalEntry(
childAnchor: childAnchor,
portalAnchor: overlayAnchor,
return PortalTarget(
anchor: Aligned(
follower: overlayAnchor ?? Alignment.center,
target: childAnchor ?? Alignment.center,
),
visible: visibleOverlay != null,
portal: visibleOverlay?.widget,
portalFollower: visibleOverlay?.widget,
child: child,
);
}
Expand Down
8 changes: 4 additions & 4 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: 4.0.0
version: 4.0.1
repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues

Expand All @@ -21,7 +21,7 @@ dependencies:
flutter:
sdk: flutter
flutter_markdown: ^0.6.1
flutter_portal: ^0.4.0
flutter_portal: ^1.0.0
flutter_slidable: ^1.2.0
flutter_svg: ^1.0.1
http_parser: ^4.0.0
Expand All @@ -36,9 +36,9 @@ dependencies:
rxdart: ^0.27.0
share_plus: ^4.0.1
shimmer: ^2.0.0
stream_chat_flutter_core: ^4.0.0
stream_chat_flutter_core: ^4.0.1
substring_highlight: ^1.0.26
url_launcher: ^6.0.3
url_launcher: ^6.1.0
video_player: ^2.1.0
video_thumbnail: ^0.5.0

Expand Down
Loading

0 comments on commit 5f0a309

Please sign in to comment.