app-starlock/lib/main/lockDetail/lockSet/importOtherLockData/ImportOtherLockData_page.dart
魏少阳 15af50d951 1、完善星锁APP国际化 36种语言。
2、修复国际化问题
2024-10-15 18:32:11 +08:00

201 lines
6.0 KiB
Dart
Executable File

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart';
class ImportOtherLockDataPage extends StatefulWidget {
const ImportOtherLockDataPage({Key? key}) : super(key: key);
@override
State<ImportOtherLockDataPage> createState() =>
_ImportOtherLockDataPageState();
}
class _ImportOtherLockDataPageState extends State<ImportOtherLockDataPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: '导入其他锁数据'.tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
actionsList: [
IconButton(
icon: Image.asset(
'images/icon_bar_tips.png',
width: 32.w,
height: 32.w,
),
onPressed: () {},
),
],
),
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(top: 30.w, left: 20.w, right: 20.w),
child: Text(
'请选择要从哪把锁导入'.tr,
style: TextStyle(fontSize: 22.sp),
)),
_searchWidget(),
SizedBox(
height: 10.h,
),
Expanded(child: _buildMainUI()),
SizedBox(
height: 20.h,
),
Container(
margin: EdgeInsets.only(left: 20.w, right: 20.w),
child: SubmitBtn(
btnName: '确定'.tr, onClick: () {}),
),
SizedBox(
height: 40.h,
)
],
),
);
}
Widget _searchWidget() {
return Container(
height: 60.h,
margin: EdgeInsets.only(top: 30.w, left: 20.w, right: 10.w),
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(5)),
child: TextField(
//输入框一行
maxLines: 1,
// controller: _controller,
autofocus: false,
decoration: InputDecoration(
//输入里面输入文字内边距设置
contentPadding: const EdgeInsets.only(
top: 12.0, left: -19.0, right: -15.0, bottom: 8.0),
hintText: '请输入'.tr,
hintStyle: TextStyle(fontSize: 22.sp, height: 3.0),
//不需要输入框下划线
border: InputBorder.none,
//左边图标设置
icon: Padding(
padding: EdgeInsets.only(
top: 20.h, bottom: 20.h, right: 20.w, left: 10.w),
child: Image.asset(
'images/main/icon_main_search.png',
width: 40.w,
height: 40.w,
),
),
),
),
);
}
Widget _buildMainUI() {
return ListView.separated(
itemCount: 2,
itemBuilder: (c, index) {
return _electronicKeyItem('images/icon_round_unSelect.png', '',
'2023.6.21 11.15', '2023.6.21 11.15', index,() {
// Navigator.pushNamed(context, Routers.electronicKeyDetailPage);
});
},
separatorBuilder: (BuildContext context, int index) {
return const Divider(
height: 1,
color: AppColors.greyLineColor,
);
},
);
}
Widget _electronicKeyItem(String lockTypeIcon, String lockTypeTitle,
String beginTime, String endTime, int index,Function() action) {
return GestureDetector(
onTap: action,
child: Container(
height: 60.h,
// margin: EdgeInsets.only(top: 15.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10.w),
),
child: Row(
children: [
SizedBox(
width: 30.w,
),
Image.asset(
lockTypeIcon,
width: 30.w,
height: 30.w,
),
SizedBox(
width: 10.w,
),
Text(
'${''.tr}${index+1}',
style: TextStyle(
color: AppColors.blackColor,
fontSize: 22.sp,
fontWeight: FontWeight.w600),
),
/*
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
// color: Colors.red,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
lockTypeTitle,
style: TextStyle(
fontSize: 32.sp, fontWeight: FontWeight.w500),
),
SizedBox(width: 20.w),
Text(
"待接收",
style: TextStyle(
fontSize: 24.sp, fontWeight: FontWeight.w500),
),
],
),
),
SizedBox(width: 20.w),
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
"2023.6.21 11.15-2023.6.21 11.15",
style: TextStyle(
fontSize: 28.sp, fontWeight: FontWeight.w500),
),
],
),
),
SizedBox(width: 20.h),
],
),
),
*/
SizedBox(width: 20.h),
],
),
),
);
}
}