1、聚合搜索关注
This commit is contained in:
parent
c230d159ab
commit
f4dcf8a52d
@ -274,21 +274,20 @@ class _SearchResultPageState extends State<SearchResultPage> with SingleTickerPr
|
||||
final vlogerId = user['id'];
|
||||
final doIFollowVloger = user['doIFollowVloger'];
|
||||
print('是否关注此用户------------->${doIFollowVloger}');
|
||||
print('此用户UserId------------->${vlogerId}');
|
||||
if (doIFollowVloger == false) {
|
||||
if (doIFollowVloger == null || doIFollowVloger == false) {
|
||||
final res = await ImService.instance.followUser(userIDList: [vlogerId]);
|
||||
print('关注结果------------->${res.success}');
|
||||
if (res.success) {
|
||||
setState(() {
|
||||
_userResults[index]['doIFollowVloger'] = !_userResults[index]['doIFollowVloger'];
|
||||
_userResults[index]['doIFollowVloger'] = true;
|
||||
});
|
||||
}
|
||||
}else{
|
||||
final res = await ImService.instance.followUser(userIDList: [vlogerId]);
|
||||
final res = await ImService.instance.unfollowUser(userIDList: [vlogerId]);
|
||||
print('取消关注结果------------->${res.success}');
|
||||
if (res.success) {
|
||||
setState(() {
|
||||
_userResults[index]['doIFollowVloger'] = !_userResults[index]['doIFollowVloger'];
|
||||
_userResults[index]['doIFollowVloger'] = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -883,7 +882,7 @@ class _SearchResultPageState extends State<SearchResultPage> with SingleTickerPr
|
||||
Widget _buildUserItem(Map<String, dynamic> user, int index) {
|
||||
// 判断当前用户是否已被关注
|
||||
bool isFollowing = user['doIFollowVloger'] ?? false;
|
||||
|
||||
print('111111111111111111111111${isFollowing}');
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(bottom: 8),
|
||||
padding: const EdgeInsets.all(10),
|
||||
|
Loading…
x
Reference in New Issue
Block a user