Skip to content

Commit

Permalink
Merge pull request #1669 from GetStream/release/v6.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xsahil03x authored Jul 12, 2023
2 parents bcf7f25 + c742abc commit 3b957ee
Show file tree
Hide file tree
Showing 43 changed files with 236 additions and 307 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/legacy_version_analyze.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: legacy_version_analyze

env:
# Note: The versions below should be manually updated after a new stable
# version comes out.
flutter_version: "3.7.12"

on:
push:
branches:
- master
- develop
paths:
- 'packages/**'
- '.github/workflows/legacy_version_analyze.yml'
pull_request:
branches:
- master
- develop
paths:
- 'packages/**'
- '.github/workflows/legacy_version_analyze.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
# Does a sanity check that packages at least pass analysis on the N-1
# versions of Flutter stable if the package claims to support that version.
# This is to minimize accidentally making changes that break old versions
# (which we don't commit to supporting, but don't want to actively break)
# without updating the constraints.
analyze_legacy_versions:
timeout-minutes: 15
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: "Git Checkout"
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: "Install Flutter"
uses: subosito/flutter-action@v2
with:
cache: true
flutter-version: ${{ env.flutter_version }}

- name: "Install Tools"
run: flutter pub global activate melos

- name: "Bootstrap Workspace"
run: melos bootstrap --verbose

# Only analyze lib/; non-client code doesn't need to work on
# all supported legacy version.
- name: "Stream Chat Analyze"
run: cd packages/stream_chat/lib && dart analyze --fatal-infos .

- name: "Stream Chat Flutter Core Analyze"
run: cd packages/stream_chat_flutter_core/lib && dart analyze --fatal-infos .

- name: "Stream Chat Flutter Analyze"
run: cd packages/stream_chat_flutter/lib && dart analyze --fatal-infos .

- name: "Stream Chat Persistence Analyze"
run: cd packages/stream_chat_persistence/lib && dart analyze --fatal-infos .

- name: "Stream Chat Localizations Analyze"
run: cd packages/stream_chat_localizations/lib && dart analyze --fatal-infos .
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 @@
## 6.5.0

🔄 Changed

- Updated minimum supported `SDK` version to Dart 2.19

## 6.4.0

🐞 Fixed
Expand Down
8 changes: 2 additions & 6 deletions packages/stream_chat/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@ publish_to: "none"
version: 1.0.0+1

environment:
sdk: '>=2.17.0 <4.0.0'
flutter: ">=1.17.0"
sdk: '>=2.19.0 <4.0.0'
flutter: ">=3.7.0"

dependencies:
cupertino_icons: ^1.0.5
flutter:
sdk: flutter
stream_chat: ^6.4.0

dev_dependencies:
flutter_test:
sdk: flutter

flutter:
uses-material-design: true
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 = '6.4.0';
const PACKAGE_VERSION = '6.5.0';
20 changes: 10 additions & 10 deletions packages/stream_chat/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
name: stream_chat
homepage: https://getstream.io/
description: The official Dart client for Stream Chat, a service for building chat applications.
version: 6.4.0
version: 6.5.0
repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues

environment:
sdk: '>=2.17.0 <4.0.0'
sdk: '>=2.19.0 <4.0.0'

dependencies:
async: ^2.10.0
collection: ^1.17.0
dio: ^5.2.0
dio: ^5.2.1+1
equatable: ^2.0.5
freezed_annotation: ^2.2.0
http_parser: ^4.0.2
jose: ^0.3.3
json_annotation: ^4.8.0
logging: ^1.1.1
json_annotation: ^4.8.1
logging: ^1.2.0
meta: ^1.8.0
mime: ^1.0.4
rate_limiter: ^1.0.0
rxdart: ^0.27.7
synchronized: ^3.0.0
synchronized: ^3.1.0
uuid: ^3.0.7
web_socket_channel: ^2.3.0
web_socket_channel: ^2.4.0

dev_dependencies:
build_runner: ^2.3.3
freezed: ^2.3.2
json_serializable: ^6.6.1
freezed: ^2.4.0
json_serializable: ^6.6.2
mocktail: ^0.3.0
test: ^1.24.1
test: ^1.24.3
7 changes: 6 additions & 1 deletion packages/stream_chat_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 6.6.0

🔄 Changed

- Updated minimum supported `SDK` version to Flutter 3.7/Dart 2.19

## 6.5.0

🐞 Fixed
Expand Down Expand Up @@ -98,7 +104,6 @@
- Updated `chewie` dependency to `^1.6.0`.
- Updated `share_plus` dependency to `^7.0.2`.
- Deprecated `StreamUserItem` in favor of `StreamUserListTile`.
- Updated `jiffy` dependency to `^6.2.1`.

## 6.4.0

Expand Down
63 changes: 3 additions & 60 deletions packages/stream_chat_flutter/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,13 @@
name: stream_chat_flutter_example
description: A new Flutter project.

# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
publish_to: 'none'
version: 1.0.0+1

environment:
sdk: '>=2.17.0 <4.0.0'
flutter: ">=1.17.0"
sdk: '>=2.19.0 <4.0.0'
flutter: ">=3.7.0"

dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
collection: ^1.15.0
cupertino_icons: ^1.0.4
flutter:
Expand All @@ -33,48 +17,7 @@ dependencies:
stream_chat_localizations: ^5.4.0
stream_chat_persistence: ^6.4.0

dev_dependencies:
flutter_test:
sdk: flutter

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true

# To add assets to your application, add an assets section, like this:
assets:
- assets/background_doodle.png
# - images/a_dot_ham.jpeg

# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.

# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages

# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,9 @@ class _ConnectedTitleState extends StatelessWidget {
style: textStyle,
);
} else {
final lastActive = otherMember.user?.lastActive ?? DateTime.now();
alternativeWidget = Text(
'${context.translations.userLastOnlineText} '
'${Jiffy.parseFromDateTime(lastActive).fromNow()}',
'${Jiffy(otherMember.user?.lastActive).fromNow()}',
style: textStyle,
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,16 +349,16 @@ class _Date extends StatelessWidget {

if (lastMessageAt.millisecondsSinceEpoch >=
startOfDay.millisecondsSinceEpoch) {
stringDate = Jiffy.parseFromDateTime(lastMessageAt.toLocal()).jm;
stringDate = Jiffy(lastMessageAt.toLocal()).jm;
} else if (lastMessageAt.millisecondsSinceEpoch >=
startOfDay
.subtract(const Duration(days: 1))
.millisecondsSinceEpoch) {
stringDate = context.translations.yesterdayLabel;
} else if (startOfDay.difference(lastMessageAt).inDays < 7) {
stringDate = Jiffy.parseFromDateTime(lastMessageAt.toLocal()).EEEE;
stringDate = Jiffy(lastMessageAt.toLocal()).EEEE;
} else {
stringDate = Jiffy.parseFromDateTime(lastMessageAt.toLocal()).yMd;
stringDate = Jiffy(lastMessageAt.toLocal()).yMd;
}

return Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -611,15 +611,13 @@ class DefaultTranslations implements Translations {
} else if (date == yesterday) {
return 'yesterday';
} else {
return 'on ${Jiffy.parseFromDateTime(date).MMMd}';
return 'on ${Jiffy(date).MMMd}';
}
}

@override
String sentAtText({required DateTime date, required DateTime time}) {
final atTime = Jiffy.parseFromDateTime(time.toLocal());
return 'Sent ${_getDay(date)} at ${atTime.jm}';
}
String sentAtText({required DateTime date, required DateTime time}) =>
'Sent ${_getDay(date)} at ${Jiffy(time.toLocal()).format('HH:mm')}';

@override
String get todayLabel => 'Today';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class MessageInputFileAttachments extends StatelessWidget {
message: Message(), // dummy message
attachment: attachment,
constraints: BoxConstraints.loose(Size(
MediaQuery.sizeOf(context).width * 0.65,
MediaQuery.of(context).size.width * 0.65,
56,
)),
trailing: Padding(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,20 +669,14 @@ class _StreamMessageListViewState extends State<StreamMessageListView> {
final isPartOfThread = message.replyCount! > 0 ||
message.showInChannel == true;

final createdAt = Jiffy.parseFromDateTime(
message.createdAt.toLocal(),
);

final nextCreatedAt = Jiffy.parseFromDateTime(
nextMessage.createdAt.toLocal(),
);

if (!createdAt.isSame(nextCreatedAt, unit: Unit.day)) {
final createdAt = message.createdAt.toLocal();
final nextCreatedAt = nextMessage.createdAt.toLocal();
if (!Jiffy(createdAt).isSame(nextCreatedAt, Units.DAY)) {
separator = _buildDateDivider(nextMessage);
} else {
final hasTimeDiff = !createdAt.isSame(
final hasTimeDiff = !Jiffy(createdAt).isSame(
nextCreatedAt,
unit: Unit.minute,
Units.MINUTE,
);

final isNextUserSame =
Expand Down Expand Up @@ -1077,12 +1071,10 @@ class _StreamMessageListViewState extends State<StreamMessageListView> {

var hasTimeDiff = false;
if (nextMessage != null) {
final createdAt = Jiffy.parseFromDateTime(message.createdAt.toLocal());
final nextCreatedAt = Jiffy.parseFromDateTime(
hasTimeDiff = !Jiffy(message.createdAt.toLocal()).isSame(
nextMessage.createdAt.toLocal(),
Units.MINUTE,
);

hasTimeDiff = !createdAt.isSame(nextCreatedAt, unit: Unit.minute);
}

final hasFileAttachment =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class BottomRow extends StatelessWidget {
),
if (showTimeStamp)
Text(
Jiffy.parseFromDateTime(message.createdAt.toLocal()).jm,
Jiffy(message.createdAt.toLocal()).jm,
style: messageTheme.createdAtStyle,
),
if (showSendingIndicator)
Expand Down
12 changes: 6 additions & 6 deletions packages/stream_chat_flutter/lib/src/misc/date_divider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ class StreamDateDivider extends StatelessWidget {

@override
Widget build(BuildContext context) {
final createdAt = Jiffy.parseFromDateTime(dateTime);
final now = Jiffy.parseFromDateTime(DateTime.now());
final createdAt = Jiffy(dateTime);
final now = Jiffy(DateTime.now());

var dayInfo = createdAt.MMMd;
if (createdAt.isSame(now, unit: Unit.day)) {
if (createdAt.isSame(now, Units.DAY)) {
dayInfo = context.translations.todayLabel;
} else if (createdAt.isSame(now.subtract(days: 1), unit: Unit.day)) {
} else if (createdAt.isSame(now.subtract(days: 1), Units.DAY)) {
dayInfo = context.translations.yesterdayLabel;
} else if (createdAt.isAfter(now.subtract(days: 7), unit: Unit.day)) {
} else if (createdAt.isAfter(now.subtract(days: 7), Units.DAY)) {
dayInfo = createdAt.EEEE;
} else if (createdAt.isAfter(now.subtract(years: 1), unit: Unit.day)) {
} else if (createdAt.isAfter(now.subtract(years: 1), Units.DAY)) {
dayInfo = createdAt.MMMd;
}

Expand Down
Loading

0 comments on commit 3b957ee

Please sign in to comment.