app-starlock/star_lock/lib/tools/tf_loginInput.dart
魏少阳 87e61960c3 1、修复锁详情横向刷新问题
2、锁详情添加锁状态(待生效、正常使用、已过期等状态)
3、修复所有安卓机型,左滑删除字体不显示问题
4、修复登录、注册、忘记密码等模块切换密码框需二次点击功能
2024-03-19 18:04:51 +08:00

76 lines
2.2 KiB
Dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
/*
* 登录注册页面 input
* */
typedef BlockStrCallback = void Function(dynamic textStr);
class LoginInput{
Widget tfInput({
TextEditingController? controller,
List<TextInputFormatter>? inputFormatters,
TextInputType? keyboardType,
Color? background,
String? hintText,
bool? isHaveLeftWidget,
Widget? leftWidget,
String? label,
bool? isPwd,
Widget? rightSlot,
BlockStrCallback? onchangeAction}) {
return SizedBox(
// color: Colors.red,
width: 1.sp,
// height: 200.h,
child: Column(
children: [
Row(
children: [
leftWidget ?? SizedBox(width: 36.w, height: 36.w),
SizedBox(width: 40.w,),
Expanded(
child: TextField(
//输入框一行
maxLines: 1,
controller: controller,
onChanged: onchangeAction,
// autofocus: false,
inputFormatters:inputFormatters,
decoration: InputDecoration(
//输入里面输入文字内边距设置
contentPadding: const EdgeInsets.only(
top: 8.0, left: -19.0, right: -15.0, bottom: 8.0),
labelText: label,
labelStyle: TextStyle(fontSize: 22.sp),
hintStyle: TextStyle(fontSize: 22.sp),
hintText: hintText,
//不需要输入框下划线
border: InputBorder.none,
//左边图标设置
// icon: isHaveLeftWidget == true
// ? leftWidget
// : SizedBox(
// width: 20.w,
// height: 40.w,
// ),
),
obscureText: isPwd ?? false,
),
),
],
),
Container(
height: 0.5.h,
color: Colors.grey,
),
],
),
);
}
}