102 lines
2.9 KiB
Dart
Raw Normal View History

2023-07-10 17:50:31 +08:00
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';
class NearbyLockPage extends StatefulWidget {
2023-07-15 15:11:28 +08:00
const NearbyLockPage({Key? key}) : super(key: key);
2023-07-10 17:50:31 +08:00
@override
State<NearbyLockPage> createState() => _NearbyLockPageState();
}
class _NearbyLockPageState extends State<NearbyLockPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.nearbyLock!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
body: ListView.separated(
itemCount: 5,
itemBuilder: (c, index) {
return nearbyLockItem(
'images/icon_lockGroup_item.png', "MCBN01-ea9240", () {
Navigator.pushNamed(context, Routers.lockAddressPage);
});
},
separatorBuilder: (BuildContext context, int index) {
return Divider(
height: 1,
color: AppColors.greyLineColor,
indent: 20.w,
endIndent: 0,
);
},
),
2023-07-10 17:50:31 +08:00
);
}
Widget nearbyLockItem(
String lockTypeIcon, String lockTypeTitle, Function() action) {
2023-07-10 17:50:31 +08:00
return GestureDetector(
onTap: action,
child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
height: 89.h,
2023-07-10 17:50:31 +08:00
color: Colors.white,
child: Row(
children: [
SizedBox(width: 20.w),
Image.asset(
lockTypeIcon,
width: 56.w,
height: 56.w,
2023-07-10 17:50:31 +08:00
),
SizedBox(width: 20.w),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
lockTypeTitle,
style: TextStyle(
fontSize: 20.sp, color: AppColors.blackColor),
),
],
),
SizedBox(
width: 10.w,
),
Image.asset(
"images/mine/icon_mine_main_about.png",
width: 22.w,
height: 22.w,
),
Expanded(child: SizedBox(width: 20.w)),
Image.asset(
'images/main/icon_main_addLock.png',
width: 36.w,
height: 36.w,
),
SizedBox(width: 30.w),
2023-07-10 17:50:31 +08:00
],
),
),
],
),
);
}
void onShow() {}
2023-07-10 17:50:31 +08:00
void onHide() {}
2023-07-10 17:50:31 +08:00
}