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