fix: 黑名单展示

This commit is contained in:
guozhigq
2024-09-30 13:09:40 +08:00
parent 42da40319a
commit d4851701d6

View File

@ -61,7 +61,7 @@ class _BlackListPageState extends State<BlackListPage> {
centerTitle: false,
title: Obx(
() => Text(
'黑名单管理 - ${_blackListController.total.value}',
'黑名单管理 ${_blackListController.total.value == 0 ? '' : '- ${_blackListController.total.value}'}',
style: Theme.of(context).textTheme.titleMedium,
),
),
@ -76,8 +76,12 @@ class _BlackListPageState extends State<BlackListPage> {
if (data['status']) {
List<BlackListItem> list = _blackListController.blackList;
return Obx(
() => list.length == 1
? const SizedBox()
() => list.isEmpty
? CustomScrollView(
slivers: [
HttpError(errMsg: '你没有拉黑任何人哦_', fn: () => {})
],
)
: ListView.builder(
controller: scrollController,
itemCount: list.length,