单独缓存车牌

This commit is contained in:
2026-03-24 09:38:16 +08:00
parent 930953780d
commit d3edf95df3
4 changed files with 203 additions and 247 deletions

View File

@@ -3,6 +3,7 @@ import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
import 'package:getx_scaffold/common/utils/log_util.dart';
import 'package:ln_jq_app/common/model/vehicle_info.dart';
import 'package:shared_preferences/shared_preferences.dart';
/// 定义登录渠道的枚举类型
enum LoginChannel {
@@ -103,6 +104,9 @@ class StorageService extends GetxService {
Future<void> saveVehicleInfo(VehicleInfo data) async {
await _box.write(_vehicleInfoKey, vehicleInfoToJson(data));
final SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setString('plateNumber', data.plateNumber ?? "");
}
Future<void> saveStationCredentials(String account, String password) async {
@@ -117,6 +121,9 @@ class StorageService extends GetxService {
Future<void> clearVehicleInfo() async {
await _box.remove(_vehicleInfoKey);
final SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.remove('plateNumber');
}
Future<void> clearStationCredentials() async {