import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import '../../../../appRouters.dart'; import '../../../../app_settings/app_colors.dart'; import '../../../../tools/titleAppBar.dart'; import '../../../../translations/trans_lib.dart'; import '../../../tools/submitBtn.dart'; class LockUserManageListListPage extends StatefulWidget { const LockUserManageListListPage({Key? key}) : super(key: key); @override State createState() => _LockUserManageListListPageState(); } class _LockUserManageListListPageState extends State { @override Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( barTitle: TranslationLoader.lanKeys!.authorizedAdmin!.tr, haveBack: true, backgroundColor: AppColors.mainColor, actionsList: [ TextButton( child: Text( TranslationLoader.lanKeys!.aboutToExpire!.tr, style: const TextStyle(color: Colors.white), ), onPressed: () {}, ), ], ), body: Column( children: [ _searchWidget(), Expanded(child: _buildMainUI()), SubmitBtn( btnName: TranslationLoader.lanKeys!.sendGroupKey!.tr, borderRadius: 20.w, margin: EdgeInsets.only( left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: () { Navigator.pushNamed( context, Routers.massSendElectronicKeyManagePage); }), ], ), ); } Widget _searchWidget() { return Container( height: 80.h, margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 20.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: TranslationLoader.lanKeys!.pleaseEnter!.tr, //不需要输入框下划线 border: InputBorder.none, //左边图标设置 icon: Padding( padding: EdgeInsets.only( top: 30.w, bottom: 20.w, right: 20.w, left: 20.w), child: Image.asset( 'images/main/icon_main_search.png', width: 40.w, height: 40.w, ), ), ), ), ); } Widget _buildMainUI() { return ListView.builder( itemCount: 10, itemBuilder: (c, index) { return _electronicKeyItem('images/icon_lock.png', "张三", "2023.6.21 11.15", "2023.6.21 11.15", () { Navigator.pushNamed(context, Routers.authorizedAdminDetailPage); }); }); } Widget _electronicKeyItem(String lockTypeIcon, String lockTypeTitle, String beginTime, String endTime, Function() action) { return GestureDetector( onTap: action, child: Container( height: 100.h, margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(10.w), ), child: Row( children: [ SizedBox( width: 30.w, ), Image.asset( lockTypeIcon, width: 50.w, height: 50.w, ), SizedBox( width: 30.w, ), Expanded( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Row( mainAxisAlignment: MainAxisAlignment.start, children: [ Text( lockTypeTitle, style: TextStyle( fontSize: 32.sp, fontWeight: FontWeight.w500), ), ], ), SizedBox(height: 5.h), Container( child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ Text( "2023.6.21 11.15 永久", style: TextStyle( fontSize: 28.sp, fontWeight: FontWeight.w500), ), ], ), ), SizedBox(width: 20.h), ], ), ), SizedBox(width: 20.h), ], ), ), ); } }