app-starlock/lib/mine/gateway/gatewayConnectionLock/gatewayConnectionLockList_page.dart
2024-08-19 11:01:37 +08:00

102 lines
3.4 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/titleAppBar.dart';
import '../../../translations/trans_lib.dart';
class GatewayConnectionLockListPage extends StatefulWidget {
const GatewayConnectionLockListPage({Key? key}) : super(key: key);
@override
State<GatewayConnectionLockListPage> createState() => _GatewayConnectionLockListPageState();
}
class _GatewayConnectionLockListPageState extends State<GatewayConnectionLockListPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: '网关'.tr,
haveBack:true,
backgroundColor: AppColors.mainColor
),
body: Column(
children: [
Container(
width: 1.sw,
color: Colors.grey.shade300,
padding: EdgeInsets.all(10.h),
child: Text('网关连接的锁'.tr, style: TextStyle(fontSize: 24.sp))
),
Expanded(
child: ListView.builder(
itemCount:10,
itemBuilder: (c, index){
return _gatewayConnectionLockListItem('images/mine/icon_mine_gatewaySignal_prompt.png', 'MCBN01 8f3106', '信号强'.tr,(){
// Navigator.pushNamed(context, Routers.gatewayDetailPage);
});
}
),
)
],
),
);
}
Widget _gatewayConnectionLockListItem(String lockTypeIcon, String gateWayName, String signalStrength, Function() action){
return GestureDetector(
onTap: action,
child: Container(
// height: 100.h,
margin: const EdgeInsets.only(bottom: 2),
padding: EdgeInsets.only(left: 15.w, right: 20.w, top: 15.h, bottom: 15.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10.w),
),
child: Row(
children: [
Image.asset(lockTypeIcon, width: 70.w, height: 70.w,),
SizedBox(width: 20.w,),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
// color: Colors.red,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(gateWayName, style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w500)),
],
),
),
SizedBox(height:5.h),
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Image.asset('images/mine/icon_mine_gatewaySignal_strong.png', width: 30.w, height: 30.w,),
SizedBox(width: 10.w,),
Text(signalStrength, style: TextStyle(fontSize: 22.sp, fontWeight: FontWeight.w500), ),
],
),
),
SizedBox(width:20.h),
],
),
),
SizedBox(width:20.h),
],
),
),
);
}
}