修改自动闭锁模块功能问题
This commit is contained in:
parent
e22d3fbe99
commit
8401514838
@ -27,7 +27,7 @@ class AutomaticBlockingLogic extends BaseGetXController {
|
||||
if (state.isCustomLockTime.value == true) {
|
||||
autoTime = state.timeController.text;
|
||||
if (int.parse(autoTime) > 60) {
|
||||
showToast('请输入小于或等于60的数字'.tr);
|
||||
showToast('请输入小于或等于60的整数'.tr);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
@ -37,7 +37,7 @@ class AutomaticBlockingLogic extends BaseGetXController {
|
||||
|
||||
final LoginEntity entity = await ApiRepository.to.setAutoUnlock(
|
||||
lockId: state.lockSetInfoData.value.lockId!,
|
||||
autoLock: state.isOpen.value == true ? 1 : 0,
|
||||
autoLock: state.isOpen.value == true ? (int.parse(state.autoLockTime.value) > 0 ? 1 : 0) : 0,
|
||||
autoLockSecond: int.parse(autoTime),
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -150,6 +151,9 @@ class _AutomaticBlockingPageState extends State<AutomaticBlockingPage>
|
||||
state.autoLockTime.value = value;
|
||||
logic.ifCanNext();
|
||||
},
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||
],
|
||||
decoration: InputDecoration(
|
||||
//输入里面输入文字内边距设置
|
||||
contentPadding: const EdgeInsets.only(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user