协议通知后注册推送

This commit is contained in:
2026-03-13 17:09:30 +08:00
parent 02e1946319
commit 84b174c4a5
3 changed files with 97 additions and 6 deletions

View File

@@ -25,11 +25,14 @@ class StorageService extends GetxService {
static const String _stationAccountKey = 'station_account';
static const String _stationPasswordKey = 'station_password';
// 新增:用于标记绑定车辆”弹窗是否已在本会话中显示过
// 新增:用于标记绑定车辆”弹窗是否已在本会话中显示过
static const String _bindDialogShownKey = 'bind_vehicle_dialog_shown';
static const String _hostUrlKey = 'host_url';
// 隐私政策相关
static const String _privacyAgreedKey = 'privacy_agreed';
static StorageService get to => Get.find();
Future<StorageService> init() async {
@@ -63,9 +66,12 @@ class StorageService extends GetxService {
String? get stationPassword => _box.read<String?>(_stationPasswordKey);
// 新增:获取绑定车辆”弹窗是否已显示的标志
// 新增:获取绑定车辆”弹窗是否已显示的标志
bool get hasShownBindVehicleDialog => _box.read<bool>(_bindDialogShownKey) ?? false;
// 获取隐私政策是否已同意
bool get isPrivacyAgreed => _box.read<bool>(_privacyAgreedKey) ?? false;
VehicleInfo? get vehicleInfo {
final vehicleJson = _box.read<String?>(_vehicleInfoKey);
if (vehicleJson != null) {
@@ -110,6 +116,11 @@ class StorageService extends GetxService {
await _box.write(_stationPasswordKey, password);
}
// 保存隐私政策同意状态
Future<void> savePrivacyAgreed(bool agreed) async {
await _box.write(_privacyAgreedKey, agreed);
}
// 新增:标记“绑定车辆”弹窗已显示
Future<void> markBindVehicleDialogAsShown() async {
await _box.write(_bindDialogShownKey, true);