fix messages update

This commit is contained in:
Salvatore Giordano
2020-03-04 17:51:14 +01:00
parent 7b4fffd719
commit 5f1764258e
3 changed files with 50 additions and 59 deletions
+7 -7
View File
@@ -95,15 +95,14 @@ class _MessageWidgetState extends State<MessageWidget>
Widget child; Widget child;
if (widget.message.type == 'deleted') {
child = _buildDeletedMessage(alignment);
} else {
var row = <Widget>[ var row = <Widget>[
Column( Column(
crossAxisAlignment: crossAxisAlignment:
isMyMessage ? CrossAxisAlignment.end : CrossAxisAlignment.start, isMyMessage ? CrossAxisAlignment.end : CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
_buildBubble(context, isLastUser), widget.message.type == 'deleted'
? _buildDeletedMessage(alignment)
: _buildBubble(context, isLastUser),
streamChannel.channel.config.replies streamChannel.channel.config.replies
? _buildThreadIndicator(context) ? _buildThreadIndicator(context)
: SizedBox(), : SizedBox(),
@@ -142,7 +141,6 @@ class _MessageWidgetState extends State<MessageWidget>
children: row, children: row,
), ),
); );
}
return AnimatedSwitcher( return AnimatedSwitcher(
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
@@ -155,7 +153,7 @@ class _MessageWidgetState extends State<MessageWidget>
alignment: alignment, alignment: alignment,
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 54, horizontal: 16,
vertical: 14, vertical: 14,
), ),
child: Text( child: Text(
@@ -551,7 +549,9 @@ class _MessageWidgetState extends State<MessageWidget>
}, },
) )
: SizedBox(), : SizedBox(),
streamChannel.channel.config.replies (streamChannel.channel.config.replies &&
widget.message.parentId == null &&
!widget.isParent)
? FlatButton( ? FlatButton(
child: Padding( child: Padding(
padding: const EdgeInsets.all(28.0), padding: const EdgeInsets.all(28.0),
+2 -11
View File
@@ -103,22 +103,13 @@ class StreamChannelState extends State<StreamChannel> {
} }
Future<void> queryMembersAndWatchers() async { Future<void> queryMembersAndWatchers() async {
String firstMemberId;
if (channel.state.members?.isNotEmpty == true) {
firstMemberId = channel.state.members.first.userId;
}
String firstWatcherId;
if (channel.state.watchers?.isNotEmpty == true) {
firstWatcherId = channel.state.watchers.first.id;
}
await widget.channel.query( await widget.channel.query(
membersPagination: PaginationParams( membersPagination: PaginationParams(
lessThan: firstMemberId, offset: channel.state.members?.length,
limit: 100, limit: 100,
), ),
watchersPagination: PaginationParams( watchersPagination: PaginationParams(
lessThan: firstWatcherId, offset: channel.state.watchers?.length,
limit: 100, limit: 100,
), ),
); );
+1 -1
View File
@@ -21,7 +21,7 @@ dependencies:
file_picker: ^1.4.3+2 file_picker: ^1.4.3+2
image_picker: ^0.6.3+4 image_picker: ^0.6.3+4
keyboard_visibility: ^0.5.6 keyboard_visibility: ^0.5.6
stream_chat: ^0.1.15 stream_chat: ^0.1.16
dev_dependencies: dev_dependencies:
pedantic: ^1.8.0+1 pedantic: ^1.8.0+1