xhj布局高级功能vip状态更新检查完善

This commit is contained in:
Daisy 2024-06-13 18:07:00 +08:00
parent a524642a88
commit 282bae9f7c
8 changed files with 46 additions and 20 deletions

View File

@ -19,11 +19,14 @@ class MassSendLockGroupListLogic extends BaseGetXController {
}
}
Future<void> getVipStatus() async {
final bool? isVip = await Storage.getBool(saveIsVip);
state.isVip.value = isVip ?? false;
state.isVip.refresh();
}
@override
Future<void> onReady() async {
super.onReady();
var isVip = await Storage.getBool(saveIsVip);
state.isVip.value = isVip ?? false;
}
}

View File

@ -27,9 +27,10 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
Get.find<MassSendLockGroupListLogic>().state;
@override
initState() {
void initState() {
super.initState();
logic.mockNetworkDataRequest();
logic.getVipStatus();
}
@override
@ -138,8 +139,7 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
currentIndex: index,
lockListByGroup: lockItemList,
isVip: state.isVip.value,
isShowBtn: true,
selectLockAction: (selectIndex, selectLockId) {
isShowBtn: true, selectLockAction: (selectIndex, selectLockId) {
LockListItem lockItem = lockItemList[selectIndex];
lockItem.isChecked = !lockItem.isChecked;
if (lockItem.isChecked) {

View File

@ -18,15 +18,17 @@ class MassSendReceiverLogic extends BaseGetXController {
}
}
Future<void> getVipStatus() async {
final bool? isVip = await Storage.getBool(saveIsVip);
state.isVip.value = isVip ?? false;
state.isVip.refresh();
}
@override
Future<void> onReady() async {
super.onReady();
final LockUserItemData data = LockUserItemData();
state.lockUserList.add(data);
final bool? isVip = await Storage.getBool(saveIsVip);
state.isVip.value = isVip ?? false;
state.isVip.refresh();
}
}

View File

@ -12,6 +12,7 @@ import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/ma
import 'package:star_lock/tools/commonItem.dart';
import 'package:star_lock/tools/regexp_tool.dart';
import 'package:star_lock/tools/showCupertinoAlertView.dart';
import 'package:star_lock/tools/storage.dart';
import 'package:star_lock/translations/trans_lib.dart';
class MassSendReceiverPage extends StatefulWidget {
@ -27,6 +28,13 @@ class _MassSendReceiverPageState extends State<MassSendReceiverPage> {
final MassSendReceiverLogic logic = Get.put(MassSendReceiverLogic());
final MassSendReceiverState state = Get.find<MassSendReceiverLogic>().state;
@override
initState() {
super.initState();
logic.getVipStatus();
}
@override
Widget build(BuildContext context) {
return Scaffold(

View File

@ -42,11 +42,14 @@ class GroupEditLockLogic extends BaseGetXController {
}
}
Future<void> getVipStatus() async {
final bool? isVip = await Storage.getBool(saveIsVip);
state.isVip.value = isVip ?? false;
state.isVip.refresh();
}
@override
onReady() async {
super.onReady();
var isVip = await Storage.getBool(saveIsVip);
state.isVip.value = isVip ?? false;
}
}

View File

@ -23,6 +23,13 @@ class _GroupEditLockPageState extends State<GroupEditLockPage> {
final GroupEditLockLogic logic = Get.put(GroupEditLockLogic());
final GroupEditLockState state = Get.find<GroupEditLockLogic>().state;
@override
void initState() {
super.initState();
logic.getVipStatus();
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -125,15 +132,13 @@ class _GroupEditLockPageState extends State<GroupEditLockPage> {
),
Expanded(
child: SizedBox(
width: 1.sw - 80.w - 75.w,
child: Text(
width: 1.sw - 80.w - 75.w,
child: Text(
itemData.lockAlias ?? '',
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(fontSize: 24.sp),
)
)
),
))),
// Text(
// itemData.lockAlias ?? '',
// style: TextStyle(fontSize: 24.sp),

View File

@ -107,10 +107,14 @@ class CustomSMSTemplateListLogic extends BaseGetXController {
textSpans.add(TextSpan(text: text, style: style));
}
Future<void> getVipStatus() async {
final bool? isVip = await Storage.getBool(saveIsVip);
state.isVip.value = isVip ?? false;
state.isVip.refresh();
}
@override
Future<void> onReady() async {
super.onReady();
var isVip = await Storage.getBool(saveIsVip);
state.isVip.value = isVip ?? false;
}
}

View File

@ -34,6 +34,7 @@ class _CustomSMSTemplateListPageState extends State<CustomSMSTemplateListPage> {
void initState() {
super.initState();
logic.getSMSTemplateListRequest(isRefresh: true);
logic.getVipStatus();
}
@override