单独缓存车牌
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user