add null check to user list view
This commit is contained in:
@@ -160,9 +160,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(),
|
||||
@@ -189,9 +187,17 @@ class _UserListViewState extends State<UserListView>
|
||||
presence: widget.presence,
|
||||
groupAlphabetically: widget.groupAlphabetically,
|
||||
userListController: _userListController,
|
||||
),
|
||||
);
|
||||
|
||||
final backgroundColor = UserListViewTheme.of(context).backgroundColor;
|
||||
|
||||
final child = backgroundColor != null
|
||||
? ColoredBox(
|
||||
color: backgroundColor,
|
||||
child: userListCore,
|
||||
)
|
||||
: userListCore;
|
||||
|
||||
if (!widget.pullToRefresh) {
|
||||
return child;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user