2023-10-07 18:55:59 +08:00

30 lines
1.0 KiB
Dart

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../lockMian/entity/lockInfoEntity.dart';
class AutomaticBlockingState {
var getKeyInfosData = KeyInfos().obs;
var isOpen = false.obs;// 是否开启自动落锁
var autoLockTime = "5".obs;
var isCustomLockTime = false.obs;// 自定义
final TextEditingController timeController = TextEditingController();
AutomaticBlockingState() {
getKeyInfosData.value = Get.arguments as KeyInfos;
isOpen.value = getKeyInfosData.value.autoLockTime! > -1 ? true : false;
autoLockTime.value = getKeyInfosData.value.autoLockTime!.toString();
if((getKeyInfosData.value.autoLockTime! > 0)
&& (getKeyInfosData.value.autoLockTime! != 5)
&& (getKeyInfosData.value.autoLockTime! != 10)
&& (getKeyInfosData.value.autoLockTime! != 15)
&& (getKeyInfosData.value.autoLockTime! != 30)
&& (getKeyInfosData.value.autoLockTime! != 60)){
isCustomLockTime.value = true;
timeController.text = autoLockTime.value;
}
}
}