Merge branch 'master' into develop

This commit is contained in:
Salvatore Giordano
2021-03-10 09:43:17 +01:00
32 changed files with 123 additions and 87 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ jobs:
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
run: |
PERCENTAGE=$(( $TOTAL * 100 / $TOTAL_MAX ))
if (( $PERCENTAGE < 100 ))
if (( $PERCENTAGE < 90 ))
then
echo Score too low!
exit 1
@@ -30,7 +30,7 @@ jobs:
run: melos bootstrap
- name: 'Dart Analyze'
run: |
melos exec -c 3 -- \
melos exec -c 3 --ignore="*example*" -- \
tuneup check
- name: 'Pub Check'
run: |
+1 -1
View File
@@ -1,4 +1,4 @@
# Official Flutter packages for [Stream Chat](https://getstream.io/chat/)
# Official Flutter packages for [Stream Chat](https://getstream.io/chat/sdk/flutter/)
![](https://raw.githubusercontent.com/GetStream/stream-chat-flutter/master/images/sdk_hero_v4.png)
+7
View File
@@ -1,3 +1,10 @@
## 1.4.0-beta
- Improved attachment uploading
- Fix: update member presence
- Added skip_push to message model
- Minor fixes and improvements
## 1.3.2+1-beta
- Fixed queryChannels bug
@@ -338,6 +338,7 @@ class Channel {
_messageAttachmentsUploadCompleter[message.id] =
attachmentsUploadCompleter;
// ignore: unawaited_futures
_uploadAttachments(
message.id,
message.attachments.map((it) => it.id),
@@ -388,6 +389,7 @@ class Channel {
_messageAttachmentsUploadCompleter[message.id] =
attachmentsUploadCompleter;
// ignore: unawaited_futures
_uploadAttachments(
message.id,
message.attachments.map((it) => it.id),
+1
View File
@@ -510,6 +510,7 @@ class StreamChatClient {
if (status == ConnectionStatus.connected &&
state.channels?.isNotEmpty == true) {
// ignore: unawaited_futures
queryChannelsOnline(filter: {
'cid': {
'\$in': state.channels.keys.toList(),
+1 -1
View File
@@ -3,4 +3,4 @@ import 'package:stream_chat/src/client.dart';
/// Current package version
/// Used in [StreamChatClient] to build the `x-stream-client` header
// ignore: constant_identifier_names
const PACKAGE_VERSION = '1.3.2+1-beta';
const PACKAGE_VERSION = '1.4.0-beta';
+2 -2
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: 1.3.2+1-beta
version: 1.4.0-beta
repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
@@ -27,4 +27,4 @@ dev_dependencies:
freezed: ^0.12.7
json_serializable: ^3.3.0
mockito: ^4.1.1
test: ^1.15.7
test: ^1.15.7
+14
View File
@@ -1,3 +1,17 @@
## 1.4.0-beta
- Unfocus `MessageInput` only when sending commands
- Updated default error for `MessageSearchListView`
- Show error messages as system and keep them in the message input
- Remove notification badge logic
- Use shimmer while loading images
- Polished `StreamChatTheme` adding more options and a new `MessageInputTheme` dedicated to `MessageInput`
- Add possibility to specify custom message actions using `MessageWidget.customActions`
- Added `MessageListView.onAttachmentTap` callback
- Fixed message newline issue
- Fixed `MessageListView` scroll keyboard behaviour
- Minor fixes and improveqments
## 1.3.2-beta
- Updated `stream_chat_core` dependency
@@ -45,10 +45,10 @@ class FileAttachment extends AttachmentWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: _getFileTypeImage(context),
height: 40.0,
width: 33.33,
margin: EdgeInsets.all(8.0),
child: _getFileTypeImage(context),
),
SizedBox(width: 8.0),
Expanded(
@@ -143,6 +143,7 @@ class GiphyAttachment extends AttachmentWidget {
Card(
color: Colors.white,
elevation: 2,
shape: CircleBorder(),
child: IconButton(
padding: const EdgeInsets.all(0),
constraints: BoxConstraints.tight(Size(32, 32)),
@@ -156,7 +157,6 @@ class GiphyAttachment extends AttachmentWidget {
});
},
),
shape: CircleBorder(),
),
Expanded(
child: Center(
@@ -171,6 +171,7 @@ class GiphyAttachment extends AttachmentWidget {
Card(
color: Colors.white,
elevation: 2,
shape: CircleBorder(),
child: IconButton(
padding: const EdgeInsets.all(0),
constraints: BoxConstraints.tight(Size(32, 32)),
@@ -184,7 +185,6 @@ class GiphyAttachment extends AttachmentWidget {
});
},
),
shape: CircleBorder(),
),
],
),
@@ -9,26 +9,32 @@ import 'package:path_provider/path_provider.dart';
import '../stream_chat_flutter.dart';
import 'extension.dart';
/// Callback to download an attachment asset
typedef AttachmentDownloader = Future<String> Function(
Attachment attachment, {
ProgressCallback progressCallback,
});
/// Widget that shows the options in the gallery view
class AttachmentActionsModal extends StatelessWidget {
/// The message containing the attachments
final Message message;
final String userName;
final String sentAt;
final List<Attachment> attachments;
/// Current page index
final currentIndex;
/// Callback to show the message
final VoidCallback onShowMessage;
/// Callback to download images
final AttachmentDownloader imageDownloader;
/// Callback to provide download files
final AttachmentDownloader fileDownloader;
/// Returns a new [AttachmentActionsModal]
const AttachmentActionsModal({
this.message,
this.userName,
this.sentAt,
this.attachments,
this.currentIndex,
this.onShowMessage,
this.imageDownloader,
@@ -85,13 +91,13 @@ class AttachmentActionsModal extends StatelessWidget {
),
_buildButton(
context,
'Save ${attachments[currentIndex].type == 'video' ? 'Video' : 'Image'}',
'Save ${message.attachments[currentIndex].type == 'video' ? 'Video' : 'Image'}',
StreamSvgIcon.iconSave(
size: 24.0,
color: theme.colorTheme.grey,
),
() {
final attachment = attachments[currentIndex];
final attachment = message.attachments[currentIndex];
final isImage = attachment.type == 'image';
final saveFile = fileDownloader ?? _downloadAttachment;
final saveImage = imageDownloader ?? _downloadAttachment;
@@ -71,12 +71,12 @@ class _ChannelFileDisplayScreenState extends State<ChannelFileDisplayScreen> {
Navigator.of(context).pop();
},
child: Container(
width: 24.0,
height: 24.0,
child: StreamSvgIcon.left(
color: StreamChatTheme.of(context).colorTheme.black,
size: 24.0,
),
width: 24.0,
height: 24.0,
),
),
),
@@ -223,8 +223,8 @@ class _ChannelListViewState extends State<ChannelListView> {
}
return AnimatedSwitcher(
child: child,
duration: const Duration(milliseconds: 500),
child: child,
);
}
@@ -469,8 +469,8 @@ class _ChannelListViewState extends State<ChannelListView> {
MaterialPageRoute(
builder: (context) {
return StreamChannel(
child: widget.channelWidget,
channel: client,
child: widget.channelWidget,
);
},
),
@@ -506,12 +506,12 @@ class _ChannelListViewState extends State<ChannelListView> {
context: context,
builder: (context) {
return StreamChannel(
channel: channel,
child: ChannelBottomSheet(
onViewInfoTap: () {
widget.onViewInfoTap(channel);
},
),
channel: channel,
);
},
);
@@ -592,13 +592,13 @@ class _ChannelListViewState extends State<ChannelListView> {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: StreamChannel(
channel: channel,
child: ChannelName(
textStyle: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
),
),
channel: channel,
),
),
],
@@ -78,12 +78,12 @@ class _ChannelMediaDisplayScreenState extends State<ChannelMediaDisplayScreen> {
Navigator.of(context).pop();
},
child: Container(
width: 24.0,
height: 24.0,
child: StreamSvgIcon.left(
color: StreamChatTheme.of(context).colorTheme.black,
size: 24.0,
),
width: 24.0,
height: 24.0,
),
),
),
@@ -237,13 +237,13 @@ class _ImageFooterState extends State<ImageFooter> {
media = InkWell(
onTap: () => widget.mediaSelectedCallBack(index),
child: AspectRatio(
aspectRatio: 1.0,
child: CachedNetworkImage(
imageUrl: attachment.imageUrl ??
attachment.assetUrl ??
attachment.thumbUrl,
fit: BoxFit.cover,
),
aspectRatio: 1.0,
),
);
}
@@ -111,10 +111,7 @@ class ImageHeader extends StatelessWidget implements PreferredSizeWidget {
return StreamChannel(
channel: channel,
child: AttachmentActionsModal(
userName: userName,
sentAt: sentAt,
message: message,
attachments: urls,
currentIndex: currentIndex,
onShowMessage: onShowMessage,
),
@@ -56,6 +56,11 @@ class _MediaListViewState extends State<MediaListView> {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 1.0, vertical: 1.0),
child: InkWell(
onTap: () {
if (widget.onSelect != null) {
widget.onSelect(media);
}
},
child: Stack(
children: [
AspectRatio(
@@ -125,11 +130,6 @@ class _MediaListViewState extends State<MediaListView> {
]
],
),
onTap: () {
if (widget.onSelect != null) {
widget.onSelect(media);
}
},
),
);
},
@@ -417,8 +417,8 @@ class MessageInputState extends State<MessageInput> {
Widget _animateSendButton(BuildContext context) {
final sendButton = widget.activeSendButton != null
? InkWell(
child: widget.activeSendButton,
onTap: sendMessage,
child: widget.activeSendButton,
)
: _buildSendButton(context);
return Padding(
@@ -1083,81 +1083,81 @@ class MessageInputState extends State<MessageInput> {
switch (iconType) {
case 'giphy':
return CircleAvatar(
radius: 12,
child: StreamSvgIcon.giphyIcon(
size: 24.0,
),
radius: 12,
);
break;
case 'ban':
return CircleAvatar(
backgroundColor: StreamChatTheme.of(context).colorTheme.accentBlue,
radius: 12,
child: StreamSvgIcon.iconUserDelete(
size: 16.0,
color: Colors.white,
),
radius: 12,
);
break;
case 'flag':
return CircleAvatar(
backgroundColor: StreamChatTheme.of(context).colorTheme.accentBlue,
radius: 12,
child: StreamSvgIcon.flag(
size: 14.0,
color: Colors.white,
),
radius: 12,
);
break;
case 'imgur':
return CircleAvatar(
backgroundColor: StreamChatTheme.of(context).colorTheme.accentBlue,
radius: 12,
child: ClipOval(
child: StreamSvgIcon.imgur(
size: 24.0,
),
),
radius: 12,
);
break;
case 'mute':
return CircleAvatar(
backgroundColor: StreamChatTheme.of(context).colorTheme.accentBlue,
radius: 12,
child: StreamSvgIcon.mute(
size: 16.0,
color: Colors.white,
),
radius: 12,
);
break;
case 'unban':
return CircleAvatar(
backgroundColor: StreamChatTheme.of(context).colorTheme.accentBlue,
radius: 12,
child: StreamSvgIcon.userAdd(
size: 16.0,
color: Colors.white,
),
radius: 12,
);
break;
case 'unmute':
return CircleAvatar(
backgroundColor: StreamChatTheme.of(context).colorTheme.accentBlue,
radius: 12,
child: StreamSvgIcon.volumeUp(
size: 16.0,
color: Colors.white,
),
radius: 12,
);
break;
default:
return CircleAvatar(
backgroundColor: StreamChatTheme.of(context).colorTheme.accentBlue,
radius: 12,
child: StreamSvgIcon.lightning(
size: 16.0,
color: Colors.white,
),
radius: 12,
);
break;
}
@@ -1677,8 +1677,8 @@ class MessageInputState extends State<MessageInput> {
);
default:
return Container(
child: Icon(Icons.insert_drive_file),
color: Colors.black26,
child: Icon(Icons.insert_drive_file),
);
}
}
@@ -2147,6 +2147,9 @@ class MessageInputState extends State<MessageInput> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
child: Text(
'OK',
style: StreamChatTheme.of(context)
@@ -2157,9 +2160,6 @@ class MessageInputState extends State<MessageInput> {
.colorTheme
.accentBlue),
),
onPressed: () {
Navigator.of(context).pop();
},
),
],
),
@@ -2298,6 +2298,7 @@ class __PickerWidgetState extends State<_PickerWidget> {
child: Container(
constraints: BoxConstraints.expand(),
color: StreamChatTheme.of(context).colorTheme.whiteSmoke,
alignment: Alignment.center,
child: Text(
'Add more files',
style: TextStyle(
@@ -2305,7 +2306,6 @@ class __PickerWidgetState extends State<_PickerWidget> {
fontWeight: FontWeight.bold,
),
),
alignment: Alignment.center,
),
);
}
@@ -624,9 +624,6 @@ class _MessageListViewState extends State<MessageListView> {
children: [
FloatingActionButton(
backgroundColor: StreamChatTheme.of(context).colorTheme.white,
child: StreamSvgIcon.down(
color: StreamChatTheme.of(context).colorTheme.black,
),
onPressed: () {
if (unreadCount > 0) {
streamChannel.channel.markRead();
@@ -644,6 +641,9 @@ class _MessageListViewState extends State<MessageListView> {
);
}
},
child: StreamSvgIcon.down(
color: StreamChatTheme.of(context).colorTheme.black,
),
),
if (showUnreadCount)
Positioned(
@@ -1045,10 +1045,6 @@ class _MessageListViewState extends State<MessageListView> {
end: colorTheme.white.withOpacity(0),
),
duration: const Duration(seconds: 3),
child: Padding(
padding: const EdgeInsets.only(top: 4.0),
child: child,
),
onEnd: () => initialMessageHighlightComplete = true,
builder: (_, color, child) {
return Container(
@@ -1056,6 +1052,10 @@ class _MessageListViewState extends State<MessageListView> {
child: child,
);
},
child: Padding(
padding: const EdgeInsets.only(top: 4.0),
child: child,
),
);
}
return child;
@@ -238,6 +238,9 @@ class MessageReactionsModal extends StatelessWidget {
borderRadius: BorderRadius.circular(32),
),
Positioned(
bottom: 6,
left: isCurrentUser ? -3 : null,
right: isCurrentUser ? -3 : null,
child: Align(
alignment:
reverse ? Alignment.centerRight : Alignment.centerLeft,
@@ -251,9 +254,6 @@ class MessageReactionsModal extends StatelessWidget {
highlightOwnReactions: false,
),
),
bottom: 6,
left: isCurrentUser ? -3 : null,
right: isCurrentUser ? -3 : null,
),
],
),
@@ -377,9 +377,9 @@ class _MessageWidgetState extends State<MessageWidget>
portal: Container(
transform:
Matrix4.translationValues(-12, 0, 0),
child: _buildReactionIndicator(context),
constraints:
BoxConstraints(maxWidth: 22 * 6.0),
child: _buildReactionIndicator(context),
),
portalAnchor: Alignment(-1.0, -1.0),
childAnchor: Alignment(1, -1.0),
@@ -94,6 +94,19 @@ class _ReactionPickerState extends State<ReactionPicker>
height: 24,
width: 24,
),
onPressed: () {
if (ownReactionIndex != -1) {
removeReaction(
context,
widget.message.ownReactions[ownReactionIndex],
);
} else {
sendReaction(
context,
reactionIcon.type,
);
}
},
child: AnimatedBuilder(
animation: animations[index],
builder: (context, val) {
@@ -121,19 +134,6 @@ class _ReactionPickerState extends State<ReactionPicker>
),
);
}),
onPressed: () {
if (ownReactionIndex != -1) {
removeReaction(
context,
widget.message.ownReactions[ownReactionIndex],
);
} else {
sendReaction(
context,
reactionIcon.type,
);
}
},
),
);
})
@@ -92,9 +92,9 @@ class StreamChatState extends State<StreamChat> {
),
child: StreamChatCore(
client: client,
child: widget.child,
onBackgroundEventReceived: widget.onBackgroundEventReceived,
backgroundKeepAlive: widget.backgroundKeepAlive,
child: widget.child,
),
);
},
@@ -13,7 +13,6 @@ class StreamNeumorphicButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
child: child,
margin: EdgeInsets.all(8.0),
height: 40,
width: 40,
@@ -35,6 +34,7 @@ class StreamNeumorphicButton extends StatelessWidget {
),
],
),
child: child,
);
}
}
@@ -28,6 +28,9 @@ class UrlAttachment extends StatelessWidget {
Container(
clipBehavior: Clip.antiAliasWithSaveLayer,
margin: EdgeInsets.symmetric(horizontal: 8.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.0),
),
child: Stack(
children: [
CachedNetworkImage(
@@ -39,6 +42,12 @@ class UrlAttachment extends StatelessWidget {
left: 0.0,
bottom: -1,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topRight: Radius.circular(16.0),
),
color: StreamChatTheme.of(context).colorTheme.blueAlice,
),
child: Padding(
padding: const EdgeInsets.only(
top: 8.0,
@@ -57,19 +66,10 @@ class UrlAttachment extends StatelessWidget {
),
),
),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topRight: Radius.circular(16.0),
),
color: StreamChatTheme.of(context).colorTheme.blueAlice,
),
),
),
],
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.0),
),
),
Padding(
padding: textPadding,
+1 -1
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: 1.3.2-beta
version: 1.4.0-beta
repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
@@ -1,3 +1,8 @@
## 1.4.0-beta
* Added `MessageListCore.messageFilter` to filter messages locally
* Minor fixes and improvements
## 1.3.2-beta
* Update llc dependency
@@ -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: 1.3.2-beta
version: 1.4.0-beta
repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
@@ -1,3 +1,7 @@
## 1.4.0-beta
* Update llc dependency
## 1.3.0-beta
* Update llc dependency
@@ -11,7 +11,7 @@ dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.0
stream_chat: ^1.3.0
stream_chat: ^1.4.0
stream_chat_persistence:
path: ../
@@ -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: 1.3.0-beta
version: 1.4.0-beta
repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues