2023-07-15 15:11:28 +08:00

74 lines
2.3 KiB
Dart

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 {
const NearbyLockPage({Key? key}) : super(key: key);
@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.builder(
itemCount:20,
itemBuilder: (c, index){
return nearbyLockItem('images/icon_lock.png', "MCBN01-ea9240", (){
Navigator.pushNamed(context, Routers.lockAddressPage);
});
}
),
);
}
Widget nearbyLockItem(String lockTypeIcon, String lockTypeTitle, Function() action){
return GestureDetector(
onTap: action,
child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
height: 80.h,
color: Colors.white,
child: Row(
children: [
SizedBox(width:20.w),
Image.asset(lockTypeIcon, width: 50.w, height: 50.w,),
SizedBox(width:20.w),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(lockTypeTitle, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ),
],
),
),
SizedBox(width:20.w),
Image.asset('images/main/icon_main_addLock.png', width: 50.w, height: 50.w,),
SizedBox(width:30.w),
],
),
),
Container(height: 0.5.h, color: Colors.grey,)
],
),
);
}
void onShow(){
}
void onHide(){
}
}