Merge branch 'master' into develop

This commit is contained in:
Salvatore Giordano
2021-03-02 11:52:42 +01:00
21 changed files with 187 additions and 59 deletions
+102
View File
@@ -0,0 +1,102 @@
name: pana
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
on:
pull_request:
branches:
- master
paths-ignore:
- 'docs/**'
push:
branches:
- master
paths-ignore:
- 'docs/**'
jobs:
stream_chat:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: axel-op/dart-package-analyzer@v3
id: analysis
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
relativePath: packages/stream_chat
- name: Check scores
env:
# NB: "analysis" is the id set above. Replace it with the one you used if different.
TOTAL: ${{ steps.analysis.outputs.total }}
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
run: |
PERCENTAGE=$(( $TOTAL * 100 / $TOTAL_MAX ))
if (( $PERCENTAGE < 100 ))
then
echo Score too low!
exit 1
fi
stream_chat_persistence:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: axel-op/dart-package-analyzer@v3
id: analysis
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
relativePath: packages/stream_chat_persistence
- name: Check scores
env:
# NB: "analysis" is the id set above. Replace it with the one you used if different.
TOTAL: ${{ steps.analysis.outputs.total }}
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
run: |
PERCENTAGE=$(( $TOTAL * 100 / $TOTAL_MAX ))
if (( $PERCENTAGE < 90 ))
then
echo Score too low!
exit 1
fi
stream_chat_flutter_core:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: axel-op/dart-package-analyzer@v3
id: analysis
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
relativePath: packages/stream_chat_flutter_core
- name: Check scores
env:
# NB: "analysis" is the id set above. Replace it with the one you used if different.
TOTAL: ${{ steps.analysis.outputs.total }}
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
run: |
PERCENTAGE=$(( $TOTAL * 100 / $TOTAL_MAX ))
if (( $PERCENTAGE < 100 ))
then
echo Score too low!
exit 1
fi
stream_chat_flutter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: axel-op/dart-package-analyzer@v3
id: analysis
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
relativePath: packages/stream_chat_flutter
- name: Check scores
env:
# NB: "analysis" is the id set above. Replace it with the one you used if different.
TOTAL: ${{ steps.analysis.outputs.total }}
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
run: |
PERCENTAGE=$(( $TOTAL * 100 / $TOTAL_MAX ))
if (( $PERCENTAGE < 90 ))
then
echo Score too low!
exit 1
fi
@@ -17,7 +17,7 @@ jobs:
timeout-minutes: 15 timeout-minutes: 15
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
- name: 'Install Flutter' - name: 'Install Flutter'
@@ -40,7 +40,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 15 timeout-minutes: 15
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
- name: 'Install Flutter' - name: 'Install Flutter'
@@ -73,7 +73,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 5 timeout-minutes: 5
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
- name: 'Install Flutter' - name: 'Install Flutter'
@@ -89,7 +89,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 15 timeout-minutes: 15
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
- name: 'Install Flutter' - name: 'Install Flutter'
+4
View File
@@ -1,3 +1,7 @@
## 1.3.2+1-beta
- Fixed queryChannels bug
## 1.3.1-beta ## 1.3.1-beta
- Debounced frequent db calls - Debounced frequent db calls
@@ -1692,11 +1692,14 @@ class ChannelClientState {
set _channelState(ChannelState v) { set _channelState(ChannelState v) {
_channelStateController.add(v); _channelStateController.add(v);
debounce(
timeout: Duration(milliseconds: 500), if (_channel._client.persistenceEnabled) {
target: _channel._client.chatPersistenceClient?.updateChannelState, debounce(
positionalArguments: [v], timeout: Duration(milliseconds: 500),
); target: _channel._client.chatPersistenceClient?.updateChannelState,
positionalArguments: [v],
);
}
} }
/// The channel threads related to this channel /// The channel threads related to this channel
+3 -1
View File
@@ -611,7 +611,9 @@ class StreamChatClient {
options: options, options: options,
paginationParams: paginationParams, paginationParams: paginationParams,
messageLimit: messageLimit, messageLimit: messageLimit,
); ).whenComplete(() {
_queryChannelsStreams.remove(hash);
});
_queryChannelsStreams[hash] = newQueryChannelsFuture; _queryChannelsStreams[hash] = newQueryChannelsFuture;
+2 -2
View File
@@ -1,5 +1,5 @@
import 'package:stream_chat/src/client.dart'; import 'package:stream_chat/src/client.dart';
/// Current package version /// Current package version
/// Used in [StreamChatClient] to build the `X-Stream-Client` header /// Used in [StreamChatClient] to build the `x-stream-client` header
const PACKAGE_VERSION = '1.3.1-beta'; const PACKAGE_VERSION = '1.3.2+1-beta';
+1 -1
View File
@@ -1,7 +1,7 @@
name: stream_chat name: stream_chat
homepage: https://getstream.io/ homepage: https://getstream.io/
description: The official Dart client for Stream Chat, a service for building chat applications. description: The official Dart client for Stream Chat, a service for building chat applications.
version: 1.3.1-beta version: 1.3.2+1-beta
repository: https://github.com/GetStream/stream-chat-flutter repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
@@ -1,3 +1,8 @@
## 1.3.2-beta
- Updated `stream_chat_core` dependency
- Fixed minor bugs
## 1.3.1-beta ## 1.3.1-beta
- Updated `stream_chat_core` dependency - Updated `stream_chat_core` dependency
@@ -202,24 +202,26 @@ class GiphyAttachment extends AttachmentWidget {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child: FlatButton( child: Container(
height: 50, height: 50,
onPressed: () { child: TextButton(
streamChannel.channel.sendAction(message, { onPressed: () {
'image_action': 'cancel', streamChannel.channel.sendAction(message, {
}); 'image_action': 'cancel',
}, });
child: Text( },
'Cancel', child: Text(
style: StreamChatTheme.of(context) 'Cancel',
.textTheme style: StreamChatTheme.of(context)
.bodyBold .textTheme
.copyWith( .bodyBold
color: StreamChatTheme.of(context) .copyWith(
.colorTheme color: StreamChatTheme.of(context)
.black .colorTheme
.withOpacity(0.5), .black
), .withOpacity(0.5),
),
),
), ),
), ),
), ),
@@ -232,20 +234,22 @@ class GiphyAttachment extends AttachmentWidget {
height: 50.0, height: 50.0,
), ),
Expanded( Expanded(
child: FlatButton( child: Container(
height: 50, height: 50,
onPressed: () { child: TextButton(
streamChannel.channel.sendAction(message, { onPressed: () {
'image_action': 'send', streamChannel.channel.sendAction(message, {
}); 'image_action': 'send',
}, });
child: Text( },
'Send', child: Text(
style: TextStyle( 'Send',
color: StreamChatTheme.of(context) style: TextStyle(
.colorTheme color: StreamChatTheme.of(context)
.accentBlue, .colorTheme
fontWeight: FontWeight.bold), .accentBlue,
fontWeight: FontWeight.bold),
),
), ),
), ),
), ),
@@ -284,7 +284,7 @@ class _ChannelListViewState extends State<ChannelListView> {
left: 0, left: 0,
bottom: 32, bottom: 32,
child: Center( child: Center(
child: FlatButton( child: TextButton(
onPressed: widget.onStartChatPressed, onPressed: widget.onStartChatPressed,
child: Text( child: Text(
'Start a chat', 'Start a chat',
@@ -445,7 +445,7 @@ class _ChannelListViewState extends State<ChannelListView> {
), ),
style: Theme.of(context).textTheme.headline6, style: Theme.of(context).textTheme.headline6,
), ),
FlatButton( TextButton(
onPressed: () => _channelListController.loadData(), onPressed: () => _channelListController.loadData(),
child: Text('Retry'), child: Text('Retry'),
), ),
@@ -42,7 +42,9 @@ class ChannelName extends StatelessWidget {
if (extraData['name'] == null) { if (extraData['name'] == null) {
final otherMembers = final otherMembers =
members.where((member) => member.userId != client.user.id); members.where((member) => member.userId != client.user.id);
if (otherMembers.isNotEmpty) { if (otherMembers.length == 1) {
title = otherMembers.first.user.name;
} else if (otherMembers.isNotEmpty) {
final maxWidth = constraints.maxWidth; final maxWidth = constraints.maxWidth;
final maxChars = maxWidth / textStyle.fontSize; final maxChars = maxWidth / textStyle.fontSize;
var currentChars = 0; var currentChars = 0;
@@ -348,7 +348,7 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
FlatButton( TextButton(
child: Text( child: Text(
'OK', 'OK',
style: StreamChatTheme.of(context) style: StreamChatTheme.of(context)
@@ -413,7 +413,7 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
FlatButton( TextButton(
child: Text( child: Text(
'OK', 'OK',
style: StreamChatTheme.of(context) style: StreamChatTheme.of(context)
@@ -2139,7 +2139,7 @@ class MessageInputState extends State<MessageInput> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
FlatButton( TextButton(
child: Text( child: Text(
'OK', 'OK',
style: StreamChatTheme.of(context) style: StreamChatTheme.of(context)
@@ -195,7 +195,7 @@ class _MessageSearchListViewState extends State<MessageSearchListView> {
padding: const EdgeInsets.only(top: 16.0), padding: const EdgeInsets.only(top: 16.0),
child: Text(message), child: Text(message),
), ),
RaisedButton( ElevatedButton(
onPressed: () { onPressed: () {
_messageSearchListController.loadData(); _messageSearchListController.loadData();
}, },
@@ -242,7 +242,7 @@ class _UserListViewState extends State<UserListView>
), ),
child: Text(message), child: Text(message),
), ),
FlatButton( TextButton(
onPressed: () { onPressed: () {
_userListController.loadData(); _userListController.loadData();
}, },
@@ -59,7 +59,7 @@ Future<bool> showConfirmationDialog(
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
FlatButton( TextButton(
child: Text( child: Text(
cancelText, cancelText,
style: StreamChatTheme.of(context) style: StreamChatTheme.of(context)
@@ -75,7 +75,7 @@ Future<bool> showConfirmationDialog(
Navigator.of(context).pop(false); Navigator.of(context).pop(false);
}, },
), ),
FlatButton( TextButton(
child: Text( child: Text(
okText, okText,
style: StreamChatTheme.of(context) style: StreamChatTheme.of(context)
@@ -145,7 +145,7 @@ Future<bool> showInfoDialog(
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
FlatButton( TextButton(
child: Text( child: Text(
okText, okText,
style: TextStyle( style: TextStyle(
+2 -2
View File
@@ -1,7 +1,7 @@
name: stream_chat_flutter name: stream_chat_flutter
homepage: https://github.com/GetStream/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. description: Stream Chat official Flutter SDK. Build your own chat experience using Dart and Flutter.
version: 1.3.1-beta version: 1.3.2-beta
repository: https://github.com/GetStream/stream-chat-flutter repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
@@ -11,7 +11,7 @@ environment:
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
stream_chat_flutter_core: ^1.3.0-beta stream_chat_flutter_core: ^1.3.2-beta
flutter_app_badger: ^1.1.2 flutter_app_badger: ^1.1.2
photo_view: ^0.10.3 photo_view: ^0.10.3
rxdart: ^0.25.0 rxdart: ^0.25.0
@@ -1,3 +1,7 @@
## 1.3.2-beta
* Update llc dependency
## 1.3.1-beta ## 1.3.1-beta
* Update llc dependency * Update llc dependency
@@ -1,7 +1,7 @@
name: stream_chat_flutter_core name: stream_chat_flutter_core
homepage: https://github.com/GetStream/stream-chat-flutter homepage: https://github.com/GetStream/stream-chat-flutter
description: Stream Chat official Flutter SDK Core. Build your own chat experience using Dart and Flutter. description: Stream Chat official Flutter SDK Core. Build your own chat experience using Dart and Flutter.
version: 1.3.1-beta version: 1.3.2-beta
repository: https://github.com/GetStream/stream-chat-flutter repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
@@ -10,7 +10,7 @@ environment:
flutter: ">=1.17.0" flutter: ">=1.17.0"
dependencies: dependencies:
stream_chat: ^1.3.1-beta stream_chat: ^1.3.2-beta
flutter: flutter:
sdk: flutter sdk: flutter
rxdart: ^0.25.0 rxdart: ^0.25.0
@@ -94,7 +94,7 @@ class ChannelQueryDao extends DatabaseAccessor<MoorChatDatabase>
?.where((s) => possibleSortingFields.contains(s.field)) ?.where((s) => possibleSortingFields.contains(s.field))
?.toList(growable: false); ?.toList(growable: false);
Comparator<ChannelModel> chainedComparator = (a, b) { var chainedComparator = (ChannelModel a, ChannelModel b) {
final dateA = a.lastMessageAt ?? a.createdAt; final dateA = a.lastMessageAt ?? a.createdAt;
final dateB = b.lastMessageAt ?? b.createdAt; final dateB = b.lastMessageAt ?? b.createdAt;
return dateB.compareTo(dateA); return dateB.compareTo(dateA);
@@ -9,6 +9,8 @@ environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.7.0 <3.0.0"
dependencies: dependencies:
flutter:
sdk: flutter
moor: ^3.4.0 moor: ^3.4.0
path: ^1.7.0 path: ^1.7.0
path_provider: ^1.6.27 path_provider: ^1.6.27