fix: 有锁的账号退出,再用一键登录会闪过之前账号的锁列表

This commit is contained in:
Liuyf 2025-04-23 14:04:50 +08:00
parent c3e7998146
commit 5313c6ecea
4 changed files with 41 additions and 30 deletions

View File

@ -9,7 +9,7 @@
"client_info": {
"mobilesdk_app_id": "1:281500445726:android:ddf52ac7b7f83cf5c4todo",
"android_client_info": {
"package_name": "com.xhjcn.lock"
"package_name": "com.xhjcn.lock.pre"
}
},
"oauth_client": [],
@ -28,7 +28,7 @@
"client_info": {
"mobilesdk_app_id": "1:281500445726:android:468195b9cc68dd6cc4todo",
"android_client_info": {
"package_name": "com.xhjcn.lock.local"
"package_name": "com.xhjcn.lock.pre"
}
},
"oauth_client": [],

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
@ -31,7 +30,9 @@ class _LockListPageState extends State<LockListPage> with RouteAware {
void initState() {
super.initState();
logic = Get.put(LockListLogic(widget.lockListInfoGroupEntity));
state = Get.find<LockListLogic>().state;
state = Get
.find<LockListLogic>()
.state;
}
@override
@ -57,15 +58,14 @@ class _LockListPageState extends State<LockListPage> with RouteAware {
}
//
Widget _buildLockExpandedList(
BuildContext context, int index, GroupList itemData) {
Widget _buildLockExpandedList(BuildContext context, int index,
GroupList itemData) {
final List<LockListInfoItemEntity> lockItemList =
itemData.lockList ?? <LockListInfoItemEntity>[];
return LockListGroupView(
onTap: () {
//
if (itemData.isChecked) {
} else {}
if (itemData.isChecked) {} else {}
setState(() {});
},
typeImgList: const <dynamic>[],
@ -135,8 +135,8 @@ class _LockListPageState extends State<LockListPage> with RouteAware {
);
}
Widget lockInfoListItem(
LockListInfoItemEntity keyInfo, bool isLast, Function() action) {
Widget lockInfoListItem(LockListInfoItemEntity keyInfo, bool isLast,
Function() action) {
return GestureDetector(
onTap: action,
child: Container(
@ -259,7 +259,11 @@ class _LockListPageState extends State<LockListPage> with RouteAware {
children: <Widget>[
SizedBox(width: 30.w),
Text(
"${logic.getUseKeyTypeStr(keyInfo.startDate, keyInfo.endDate, keyInfo.keyType)}/${keyInfo.isLockOwner == 1 ? '超级管理员'.tr : (keyInfo.keyRight == 1 ? "授权管理员".tr : "普通用户".tr)}",
"${logic.getUseKeyTypeStr(keyInfo.startDate, keyInfo.endDate,
keyInfo.keyType)}/${keyInfo.isLockOwner == 1
? '超级管理员'.tr
: (keyInfo.keyRight == 1 ? "授权管理员".tr : "普通用户"
.tr)}",
style: TextStyle(
fontSize: 18.sp, color: AppColors.darkGrayTextColor),
),
@ -282,9 +286,14 @@ class _LockListPageState extends State<LockListPage> with RouteAware {
@override
void dispose() {
Get.delete<LockListLogic>();
///
AppRouteObserver().routeObserver.unsubscribe(this);
super.dispose();
super
.
dispose
(
);
}
///

View File

@ -344,6 +344,7 @@ class _StarLockMainPageState extends State<StarLockMainPage>
@override
void dispose() {
super.dispose();
Get.delete<LockMainLogic>();
_teamEvent.cancel();
}

View File

@ -154,6 +154,7 @@ class Storage {
static Future<void> clearAll() async {
final SharedPreferences sp = await SharedPreferences.getInstance();
// sp.clear();
sp.remove(saveLockMainListData);
sp.remove(saveUserLoginData);
//
//退