add null check to message list view
This commit is contained in:
@@ -386,9 +386,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(
|
||||
@@ -560,8 +558,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;
|
||||
@@ -588,8 +585,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() {
|
||||
|
||||
Reference in New Issue
Block a user