fix: 个人动态无限循环 issues #340

This commit is contained in:
guozhigq
2023-12-25 22:52:20 +08:00
parent 4e8ca590b4
commit 7d54bd1641
6 changed files with 17 additions and 5 deletions

View File

@ -15,6 +15,7 @@ class FansController extends GetxController {
late String name;
var userInfo;
RxString loadingText = '加载中...'.obs;
RxBool isOwner = false.obs;
@override
void onInit() {
@ -23,6 +24,7 @@ class FansController extends GetxController {
mid = Get.parameters['mid'] != null
? int.parse(Get.parameters['mid']!)
: userInfo.mid;
isOwner.value = mid == userInfo.mid;
name = Get.parameters['name'] ?? userInfo.uname;
}

View File

@ -54,7 +54,7 @@ class _FansPageState extends State<FansPage> {
centerTitle: false,
titleSpacing: 0,
title: Text(
'${_fansController.name}的粉丝',
_fansController.isOwner.value ? '我的粉丝' : '${_fansController.name}的粉丝',
style: Theme.of(context).textTheme.titleMedium,
),
),