From 2a66fd88d02b05e9aa54283a4a2047f60c43272b Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Wed, 21 Jul 2021 12:32:01 +0200 Subject: [PATCH] fix nits --- .../lib/src/message_search_list_view.dart | 15 +++++++++------ .../lib/src/user_list_view.dart | 16 ++++++++++------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/packages/stream_chat_flutter/lib/src/message_search_list_view.dart b/packages/stream_chat_flutter/lib/src/message_search_list_view.dart index 2b37a348..13f5ea55 100644 --- a/packages/stream_chat_flutter/lib/src/message_search_list_view.dart +++ b/packages/stream_chat_flutter/lib/src/message_search_list_view.dart @@ -200,12 +200,15 @@ class _MessageSearchListViewState extends State { final backgroundColor = MessageSearchListViewTheme.of(context).backgroundColor; - return backgroundColor != null - ? ColoredBox( - color: backgroundColor, - child: messageSearchListCore, - ) - : messageSearchListCore; + + if (backgroundColor != null) { + return ColoredBox( + color: backgroundColor, + child: messageSearchListCore, + ); + } + + return messageSearchListCore; } Widget _separatorBuilder(BuildContext context, int index) => Container( diff --git a/packages/stream_chat_flutter/lib/src/user_list_view.dart b/packages/stream_chat_flutter/lib/src/user_list_view.dart index f6e30398..39d4453d 100644 --- a/packages/stream_chat_flutter/lib/src/user_list_view.dart +++ b/packages/stream_chat_flutter/lib/src/user_list_view.dart @@ -191,12 +191,16 @@ class _UserListViewState extends State final backgroundColor = UserListViewTheme.of(context).backgroundColor; - final child = backgroundColor != null - ? ColoredBox( - color: backgroundColor, - child: userListCore, - ) - : userListCore; + Widget child; + + if (backgroundColor != null) { + child = ColoredBox( + color: backgroundColor, + child: userListCore, + ); + } else { + child = userListCore; + } if (!widget.pullToRefresh) { return child;