fix:开锁页-电子钥匙、授权管理员 输入姓名30位,通通锁50位。另在详情页姓名显示不全,通通锁会显示3行

This commit is contained in:
anfe 2024-06-03 18:04:11 +08:00
parent 4f75d1a43a
commit 5baa5830ac
7 changed files with 51 additions and 30 deletions

View File

@ -196,7 +196,7 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
onTap: action, onTap: action,
child: Container( child: Container(
color: Colors.white, color: Colors.white,
height: 100.h, padding: EdgeInsets.only(top: 20.h, bottom: 20.h),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
SizedBox(width: 30.w), SizedBox(width: 30.w),
@ -226,7 +226,7 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
children: <Widget>[ children: <Widget>[
Flexible( Flexible(
child: Text(receiveUser, child: Text(receiveUser,
maxLines: 1, maxLines: 3,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 24.sp, fontSize: 24.sp,

View File

@ -44,7 +44,8 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
isHaveRightWidget: true, isHaveRightWidget: true,
setHeight: false, setHeight: false,
rightWidget: getTFWidget( rightWidget: getTFWidget(
'(${TranslationLoader.lanKeys!.mustFillIn!.tr})')), '(${TranslationLoader.lanKeys!.mustFillIn!.tr})',
maxSize: 50)),
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.startDate!.tr, leftTitel: TranslationLoader.lanKeys!.startDate!.tr,
rightTitle: state.beginDate.value.isEmpty rightTitle: state.beginDate.value.isEmpty
@ -123,7 +124,7 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
); );
} }
Widget getTFWidget(String tfStr) { Widget getTFWidget(String tfStr, {int maxSize = 30}) {
return Expanded( return Expanded(
child: TextField( child: TextField(
// //
@ -143,7 +144,7 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
isCollapsed: true, isCollapsed: true,
), ),
inputFormatters: <TextInputFormatter>[ inputFormatters: <TextInputFormatter>[
LengthLimitingTextInputFormatter(30), LengthLimitingTextInputFormatter(maxSize),
], ],
), ),
); );

View File

@ -433,6 +433,8 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
Expanded( Expanded(
child: Text( child: Text(
name!, name!,
maxLines: 3,
overflow: TextOverflow.ellipsis,
style: TextStyle(fontSize: 24.sp), style: TextStyle(fontSize: 24.sp),
), ),
), ),

View File

@ -245,7 +245,7 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
onTap: action, onTap: action,
child: Container( child: Container(
color: Colors.white, color: Colors.white,
height: 90.h, padding: EdgeInsets.only(top: 20.h, bottom: 20.h),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
SizedBox(width: 30.w), SizedBox(width: 30.w),
@ -262,11 +262,6 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
), ),
), ),
), ),
// Image.asset(
// avatarURL,
// width: 60.w,
// height: 60.w,
// ),
SizedBox(width: 20.w), SizedBox(width: 20.w),
Expanded( Expanded(
child: Column( child: Column(
@ -281,7 +276,7 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
children: <Widget>[ children: <Widget>[
Flexible( Flexible(
child: Text(receiveUser, child: Text(receiveUser,
maxLines: 1, maxLines: 3,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 24.sp, fontSize: 24.sp,

View File

@ -3,6 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/app_settings/app_colors.dart'; import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_logic.dart'; import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_logic.dart';
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_state.dart';
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_page.dart'; import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_page.dart';
import '../../../../../tools/CustomUnderlineTabIndicator.dart'; import '../../../../../tools/CustomUnderlineTabIndicator.dart';
@ -18,8 +19,8 @@ class SendElectronicKeyPage extends StatefulWidget {
class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> class _SendElectronicKeyPageState extends State<SendElectronicKeyPage>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
final logic = Get.put(SendElectronicKeyLogic()); final SendElectronicKeyLogic logic = Get.put(SendElectronicKeyLogic());
final state = Get.find<SendElectronicKeyLogic>().state; final SendElectronicKeyState state = Get.find<SendElectronicKeyLogic>().state;
@override @override
void initState() { void initState() {
@ -37,7 +38,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage>
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor), backgroundColor: AppColors.mainColor),
body: Column( body: Column(
children: [ children: <Widget>[
_tabBar(), _tabBar(),
_pageWidget(), _pageWidget(),
], ],
@ -48,10 +49,10 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage>
TabBar _tabBar() { TabBar _tabBar() {
return TabBar( return TabBar(
controller: state.tabController, controller: state.tabController,
onTap: (index) { onTap: (int index) {
FocusScope.of(context).requestFocus(FocusNode()); FocusScope.of(context).requestFocus(FocusNode());
}, },
tabs: _itemTabs.map((ItemView item) => _tab(item)).toList(), tabs: _itemTabs.map(_tab).toList(),
isScrollable: true, isScrollable: true,
indicatorColor: Colors.red, indicatorColor: Colors.red,
unselectedLabelColor: Colors.black, unselectedLabelColor: Colors.black,
@ -97,10 +98,10 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage>
} }
final List<ItemView> _itemTabs = <ItemView>[ final List<ItemView> _itemTabs = <ItemView>[
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, type: "0"), ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, type: '0'),
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, type: "1"), ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, type: '1'),
ItemView(title: TranslationLoader.lanKeys!.once!.tr, type: "2"), ItemView(title: TranslationLoader.lanKeys!.once!.tr, type: '2'),
ItemView(title: TranslationLoader.lanKeys!.circulation!.tr, type: "3"), ItemView(title: TranslationLoader.lanKeys!.circulation!.tr, type: '3'),
]; ];
} }

View File

@ -143,7 +143,8 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
rightTitle: '', rightTitle: '',
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: getTFWidget( rightWidget: getTFWidget(
false, TranslationLoader.lanKeys!.enterYourName!.tr, 2, logic)), false, TranslationLoader.lanKeys!.enterYourName!.tr, 2, logic,
maxSize: 50)),
Container(height: 10.h), Container(height: 10.h),
], ],
); );
@ -441,7 +442,8 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
// //
Widget getTFWidget(bool isHaveBtn, String tfStr, int lineIndex, Widget getTFWidget(bool isHaveBtn, String tfStr, int lineIndex,
SendElectronicKeyViewLogic logic) { SendElectronicKeyViewLogic logic,
{int maxSize = 30}) {
return SizedBox( return SizedBox(
height: 65.h, height: 65.h,
width: 320.w, width: 320.w,
@ -454,7 +456,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
maxLines: 1, maxLines: 1,
inputFormatters: <TextInputFormatter>[ inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.deny('\n'), FilteringTextInputFormatter.deny('\n'),
LengthLimitingTextInputFormatter(30), LengthLimitingTextInputFormatter(maxSize),
], ],
// controller: _controller, // controller: _controller,
autofocus: false, autofocus: false,

View File

@ -124,6 +124,23 @@ class _StarLockMainPageState extends State<StarLockMainPage> with BaseWidget {
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
// decoration: BoxDecoration(
// //
// gradient: LinearGradient(
// //
// colors: [
// AppColors.mainColor.withOpacity(0.8), //
// AppColors.mainColor.withOpacity(0.4), //
// Colors.white, //
// Colors.white, //
// ],
// //
// begin: Alignment.topLeft,
// end: Alignment.bottomRight,
// //
// stops: [0.0, 0.23, 0.47, 1],
// ),
// ),
child: child, child: child,
)); ));
return child; return child;
@ -215,12 +232,15 @@ class _StarLockMainPageState extends State<StarLockMainPage> with BaseWidget {
SizedBox( SizedBox(
height: 160.h, height: 160.h,
), ),
if (F.isLite) Container() else SubmitBtn( if (F.isLite)
btnName: '演示模式', Container()
onClick: () { else
Get.toNamed(Routers.demoModeLockDetailPage); SubmitBtn(
}, btnName: '演示模式',
) onClick: () {
Get.toNamed(Routers.demoModeLockDetailPage);
},
)
], ],
), ),
], ],