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