add null check to message search list view
This commit is contained in:
@@ -144,9 +144,8 @@ class _MessageSearchListViewState extends State<MessageSearchListView> {
|
|||||||
widget.messageSearchListController ?? _defaultController;
|
widget.messageSearchListController ?? _defaultController;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => ColoredBox(
|
Widget build(BuildContext context) {
|
||||||
color: MessageSearchListViewTheme.of(context).backgroundColor!,
|
final messageSearchListCore = MessageSearchListCore(
|
||||||
child: MessageSearchListCore(
|
|
||||||
filters: widget.filters,
|
filters: widget.filters,
|
||||||
sortOptions: widget.sortOptions,
|
sortOptions: widget.sortOptions,
|
||||||
messageQuery: widget.messageQuery,
|
messageQuery: widget.messageQuery,
|
||||||
@@ -197,9 +196,18 @@ class _MessageSearchListViewState extends State<MessageSearchListView> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
childBuilder: widget.childBuilder ?? _buildListView,
|
childBuilder: widget.childBuilder ?? _buildListView,
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
final backgroundColor =
|
||||||
|
MessageSearchListViewTheme.of(context).backgroundColor;
|
||||||
|
return backgroundColor != null
|
||||||
|
? ColoredBox(
|
||||||
|
color: backgroundColor,
|
||||||
|
child: messageSearchListCore,
|
||||||
|
)
|
||||||
|
: messageSearchListCore;
|
||||||
|
}
|
||||||
|
|
||||||
Widget _separatorBuilder(BuildContext context, int index) => Container(
|
Widget _separatorBuilder(BuildContext context, int index) => Container(
|
||||||
height: 1,
|
height: 1,
|
||||||
color: StreamChatTheme.of(context).colorTheme.borders,
|
color: StreamChatTheme.of(context).colorTheme.borders,
|
||||||
|
|||||||
Reference in New Issue
Block a user