1.修复锁版连接app提示pwd问题

2.修复小米手机输入密码问题
This commit is contained in:
sky.min 2026-01-29 15:16:04 +08:00
parent f05e8fc813
commit e47a22a53f
2 changed files with 13 additions and 27 deletions

View File

@ -54,7 +54,6 @@ class SaveLockLogic extends BaseGetXController {
// ----m
Future<void> _replySenderReadAdminPasswordReply(Reply reply) async {
AppLog.log('响应获取管理员密码: ${reply.data}');
var token = reply.data.sublist(5, 9);
var saveStrList = changeIntListToStringList(token);
Storage.setStringList(saveBlueToken, saveStrList);
@ -153,6 +152,13 @@ class SaveLockLogic extends BaseGetXController {
Storage.setStringList(saveBlueToken, strTokenList);
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) {
case 0x00:
//

View File

@ -61,7 +61,6 @@ class _LoginInputState extends State<LoginInput> {
}
Widget androidView() {
final TextEditingController _controller = TextEditingController();
bool isPwd = widget.isPwd ?? false;
String pwd = (widget.controller?.text ?? '').replaceAll(RegExp(r'.'), '');
return Container(
@ -86,10 +85,6 @@ class _LoginInputState extends State<LoginInput> {
controller: widget.controller,
focusNode: widget.focusNode,
onChanged: (String text) {
_controller.text = text;
_controller.selection = TextSelection.fromPosition(
TextPosition(offset: _controller.text.length),
);
if (widget.onchangeAction != null) {
widget.onchangeAction!(text);
}
@ -99,15 +94,14 @@ class _LoginInputState extends State<LoginInput> {
autofocus: false,
inputFormatters: widget.inputFormatters,
textInputAction: TextInputAction.next,
keyboardType: isPwd ? TextInputType.emailAddress : null,
style: isPwd
? TextStyle(
keyboardType: isPwd ? TextInputType.visiblePassword : null,
obscureText: isPwd, // 使
style: TextStyle(
fontSize: 22.sp,
color: Colors.transparent,
letterSpacing: 2.5,
color: AppColors.darkGrayTextColor, // 使
letterSpacing: 2.0,
fontFamily: 'Monospace',
)
: null,
),
decoration: InputDecoration(
//
contentPadding: const EdgeInsets.only(
@ -127,20 +121,6 @@ class _LoginInputState extends State<LoginInput> {
: 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',
),
),
),
],
),
),