1.修复锁版连接app提示pwd问题
2.修复小米手机输入密码问题
This commit is contained in:
parent
f05e8fc813
commit
e47a22a53f
@ -54,7 +54,6 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 新增----m 获取锁管理员密码
|
// 新增----m 获取锁管理员密码
|
||||||
Future<void> _replySenderReadAdminPasswordReply(Reply reply) async {
|
Future<void> _replySenderReadAdminPasswordReply(Reply reply) async {
|
||||||
AppLog.log('响应获取管理员密码: ${reply.data}');
|
|
||||||
var token = reply.data.sublist(5, 9);
|
var token = reply.data.sublist(5, 9);
|
||||||
var saveStrList = changeIntListToStringList(token);
|
var saveStrList = changeIntListToStringList(token);
|
||||||
Storage.setStringList(saveBlueToken, saveStrList);
|
Storage.setStringList(saveBlueToken, saveStrList);
|
||||||
@ -153,6 +152,13 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
Storage.setStringList(saveBlueToken, strTokenList);
|
Storage.setStringList(saveBlueToken, strTokenList);
|
||||||
|
|
||||||
final int status = reply.data[46];
|
final int status = reply.data[46];
|
||||||
|
if(state.adminPassword == ''){
|
||||||
|
final Random rng = Random();
|
||||||
|
final int number = rng.nextInt(900000) + 100000;
|
||||||
|
state.adminPassword = number.toString();
|
||||||
|
} else {
|
||||||
|
state.role = 1;
|
||||||
|
}
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
//成功 如果成功保存用户编号
|
//成功 如果成功保存用户编号
|
||||||
|
|||||||
@ -61,7 +61,6 @@ class _LoginInputState extends State<LoginInput> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget androidView() {
|
Widget androidView() {
|
||||||
final TextEditingController _controller = TextEditingController();
|
|
||||||
bool isPwd = widget.isPwd ?? false;
|
bool isPwd = widget.isPwd ?? false;
|
||||||
String pwd = (widget.controller?.text ?? '').replaceAll(RegExp(r'.'), '●');
|
String pwd = (widget.controller?.text ?? '').replaceAll(RegExp(r'.'), '●');
|
||||||
return Container(
|
return Container(
|
||||||
@ -86,10 +85,6 @@ class _LoginInputState extends State<LoginInput> {
|
|||||||
controller: widget.controller,
|
controller: widget.controller,
|
||||||
focusNode: widget.focusNode,
|
focusNode: widget.focusNode,
|
||||||
onChanged: (String text) {
|
onChanged: (String text) {
|
||||||
_controller.text = text;
|
|
||||||
_controller.selection = TextSelection.fromPosition(
|
|
||||||
TextPosition(offset: _controller.text.length),
|
|
||||||
);
|
|
||||||
if (widget.onchangeAction != null) {
|
if (widget.onchangeAction != null) {
|
||||||
widget.onchangeAction!(text);
|
widget.onchangeAction!(text);
|
||||||
}
|
}
|
||||||
@ -99,15 +94,14 @@ class _LoginInputState extends State<LoginInput> {
|
|||||||
autofocus: false,
|
autofocus: false,
|
||||||
inputFormatters: widget.inputFormatters,
|
inputFormatters: widget.inputFormatters,
|
||||||
textInputAction: TextInputAction.next,
|
textInputAction: TextInputAction.next,
|
||||||
keyboardType: isPwd ? TextInputType.emailAddress : null,
|
keyboardType: isPwd ? TextInputType.visiblePassword : null,
|
||||||
style: isPwd
|
obscureText: isPwd, // 使用系统自带的密码遮盖功能
|
||||||
? TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 22.sp,
|
fontSize: 22.sp,
|
||||||
color: Colors.transparent,
|
color: AppColors.darkGrayTextColor, // 不再使用透明色
|
||||||
letterSpacing: 2.5,
|
letterSpacing: 2.0,
|
||||||
fontFamily: 'Monospace',
|
fontFamily: 'Monospace',
|
||||||
)
|
),
|
||||||
: null,
|
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
//输入里面输入文字内边距设置
|
//输入里面输入文字内边距设置
|
||||||
contentPadding: const EdgeInsets.only(
|
contentPadding: const EdgeInsets.only(
|
||||||
@ -127,20 +121,6 @@ class _LoginInputState extends State<LoginInput> {
|
|||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (isPwd)
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
top: F.sw(skyCall: () => 27.h, xhjCall: () => widget.isLogin! ? 27.h : 39.h)),
|
|
||||||
child: Text(
|
|
||||||
pwd,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 22.sp,
|
|
||||||
color: AppColors.darkGrayTextColor,
|
|
||||||
letterSpacing: 2.0,
|
|
||||||
fontFamily: 'Monospace',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user