Files
PiliPlus/lib/services/account_service.dart
bggRGjQaUbCoE 4c758bb1a3 opt account
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
2025-06-10 13:19:58 +08:00

21 lines
558 B
Dart

import 'package:PiliPlus/models/user/info.dart';
import 'package:PiliPlus/utils/storage.dart' show GStorage;
import 'package:get/get.dart';
class AccountService extends GetxService {
late int mid;
late final RxString name;
late final RxString face;
late final RxBool isLogin;
@override
void onInit() {
super.onInit();
UserInfoData? userInfo = GStorage.userInfo.get('userInfoCache');
mid = userInfo?.mid ?? 0;
name = (userInfo?.uname ?? '').obs;
face = (userInfo?.face ?? '').obs;
isLogin = (userInfo != null).obs;
}
}