add null check to user list view
This commit is contained in:
@@ -160,38 +160,44 @@ class _UserListViewState extends State<UserListView>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final child = ColoredBox(
|
||||
color: UserListViewTheme.of(context).backgroundColor!,
|
||||
child: UserListCore(
|
||||
errorBuilder: widget.errorBuilder ??
|
||||
(BuildContext context, Object err) => _buildError(err),
|
||||
emptyBuilder: widget.emptyBuilder ?? (context) => _buildEmpty(),
|
||||
loadingBuilder: widget.loadingBuilder ??
|
||||
(context) => LayoutBuilder(
|
||||
builder: (context, viewportConstraints) =>
|
||||
SingleChildScrollView(
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
minHeight: viewportConstraints.maxHeight,
|
||||
),
|
||||
child: const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
final userListCore = UserListCore(
|
||||
errorBuilder: widget.errorBuilder ??
|
||||
(BuildContext context, Object err) => _buildError(err),
|
||||
emptyBuilder: widget.emptyBuilder ?? (context) => _buildEmpty(),
|
||||
loadingBuilder: widget.loadingBuilder ??
|
||||
(context) => LayoutBuilder(
|
||||
builder: (context, viewportConstraints) =>
|
||||
SingleChildScrollView(
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
minHeight: viewportConstraints.maxHeight,
|
||||
),
|
||||
child: const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
),
|
||||
),
|
||||
listBuilder:
|
||||
widget.listBuilder ?? (context, list) => _buildListView(list),
|
||||
pagination: widget.pagination,
|
||||
sort: widget.sort,
|
||||
filter: widget.filter,
|
||||
presence: widget.presence,
|
||||
groupAlphabetically: widget.groupAlphabetically,
|
||||
userListController: _userListController,
|
||||
),
|
||||
),
|
||||
listBuilder:
|
||||
widget.listBuilder ?? (context, list) => _buildListView(list),
|
||||
pagination: widget.pagination,
|
||||
sort: widget.sort,
|
||||
filter: widget.filter,
|
||||
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