隐私设置
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user