隐私设置

This commit is contained in:
2022-11-01 11:06:51 +08:00
parent 0b5d510766
commit ff612bcc56
4 changed files with 54 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
import 'package:chat/models/user_info_model.dart';
import 'package:chat/providers/auth_provider.dart';
import 'package:chat/providers/user_provider.dart';
import 'package:chat/routes/auth_routes.dart';
import 'package:chat/services/tim/apply_service.dart';
import 'package:chat/services/tim/block_service.dart';
@@ -123,4 +124,14 @@ class AuthService extends GetxService {
_box.write('userInfo', userInfo.toJson());
}
/// 更新隐私状态
Future<void> togglePrivacy() async {
var res = await UserProvider.togglePrivacy();
if (res != null) {
userInfo.value.privacy = res;
userInfo.refresh();
}
_box.write('userInfo', userInfo.toJson());
}
}