Merge remote-tracking branch 'origin/develop' into feat/localization

# Conflicts:
#	packages/stream_chat_flutter/lib/src/message_list_view.dart
#	packages/stream_chat_flutter/lib/src/message_search_list_view.dart
This commit is contained in:
xsahil03x
2021-07-21 17:54:32 +05:30
7 changed files with 316 additions and 278 deletions
+1
View File
@@ -19,6 +19,7 @@ jobs:
persistence
core
ui
doc
repo
localization
requireScope: true
@@ -289,6 +289,7 @@ class ChannelApi {
) async {
final response = await _client.post(
'${_getChannelUrl(channelId, channelType)}/stop-watching',
data: {},
);
return EmptyResponse.fromJson(response.data);
}
@@ -595,14 +595,14 @@ void main() {
final path = '${_getChannelUrl(channelId, channelType)}/stop-watching';
when(() => client.post(path)).thenAnswer(
when(() => client.post(path, data: {})).thenAnswer(
(_) async => successResponse(path, data: <String, dynamic>{}));
final res = await channelApi.stopWatching(channelId, channelType);
expect(res, isNotNull);
verify(() => client.post(path)).called(1);
verify(() => client.post(path, data: {})).called(1);
verifyNoMoreInteractions(client);
});
}
@@ -232,13 +232,21 @@ class _ChannelListViewState extends State<ChannelListView> {
);
}
return ColoredBox(
color: ChannelListViewTheme.of(context).backgroundColor!,
child: LazyLoadScrollView(
child = LazyLoadScrollView(
onEndOfPage: () => _channelListController.paginateData!(),
child: child,
),
);
final backgroundColor = ChannelListViewTheme.of(context).backgroundColor;
if (backgroundColor != null) {
return ColoredBox(
color: backgroundColor,
child: child,
);
}
return child;
}
Widget _buildListView(BuildContext context, List<Channel> channels) {
@@ -387,9 +387,7 @@ class _MessageListViewState extends State<MessageListView> {
1 // parent message
;
return ColoredBox(
color: MessageListViewTheme.of(context).backgroundColor!,
child: Stack(
final child = Stack(
alignment: Alignment.center,
children: [
ConnectionStatusBuilder(
@@ -561,8 +559,7 @@ class _MessageListViewState extends State<MessageListView> {
const Offstage();
}
const bottomMessageIndex =
2; // 1 -> loader // 0 -> footer
const bottomMessageIndex = 2; // 1 -> loader // 0 -> footer
final message = messages[i - 2];
Widget messageWidget;
@@ -589,8 +586,18 @@ class _MessageListViewState extends State<MessageListView> {
if (widget.showFloatingDateDivider)
_buildFloatingDateDivider(itemCount),
],
),
);
final backgroundColor = MessageListViewTheme.of(context).backgroundColor;
if (backgroundColor != null) {
return ColoredBox(
color: backgroundColor,
child: child,
);
}
return child;
}
Widget _buildThreadSeparator() {
@@ -146,9 +146,8 @@ class _MessageSearchListViewState extends State<MessageSearchListView> {
widget.messageSearchListController ?? _defaultController;
@override
Widget build(BuildContext context) => ColoredBox(
color: MessageSearchListViewTheme.of(context).backgroundColor!,
child: MessageSearchListCore(
Widget build(BuildContext context) {
final messageSearchListCore = MessageSearchListCore(
filters: widget.filters,
sortOptions: widget.sortOptions,
messageQuery: widget.messageQuery,
@@ -199,9 +198,21 @@ class _MessageSearchListViewState extends State<MessageSearchListView> {
),
),
childBuilder: widget.childBuilder ?? _buildListView,
),
);
final backgroundColor =
MessageSearchListViewTheme.of(context).backgroundColor;
if (backgroundColor != null) {
return ColoredBox(
color: backgroundColor,
child: messageSearchListCore,
);
}
return messageSearchListCore;
}
Widget _separatorBuilder(BuildContext context, int index) => Container(
height: 1,
color: StreamChatTheme.of(context).colorTheme.borders,
@@ -162,9 +162,7 @@ class _UserListViewState extends State<UserListView>
@override
Widget build(BuildContext context) {
final child = ColoredBox(
color: UserListViewTheme.of(context).backgroundColor!,
child: UserListCore(
final userListCore = UserListCore(
errorBuilder: widget.errorBuilder ??
(BuildContext context, Object err) => _buildError(err),
emptyBuilder: widget.emptyBuilder ?? (context) => _buildEmpty(),
@@ -191,9 +189,21 @@ class _UserListViewState extends State<UserListView>
presence: widget.presence,
groupAlphabetically: widget.groupAlphabetically,
userListController: _userListController,
),
);
final backgroundColor = UserListViewTheme.of(context).backgroundColor;
Widget child;
if (backgroundColor != null) {
child = ColoredBox(
color: backgroundColor,
child: userListCore,
);
} else {
child = userListCore;
}
if (!widget.pullToRefresh) {
return child;
} else {