import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/tools/noData.dart'; import '../../appRouters.dart'; import '../../app_settings/app_colors.dart'; import '../../tools/titleAppBar.dart'; import '../../translations/trans_lib.dart'; class MessageListPage extends StatefulWidget { const MessageListPage({Key? key}) : super(key: key); @override State createState() => _MessageListPageState(); } class _MessageListPageState extends State { List dataList = []; @override Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( barTitle: TranslationLoader.lanKeys!.message!.tr, haveBack: true, backgroundColor: AppColors.mainColor), body: dataList.isEmpty ? const NoData() : ListView.builder( itemCount: 10, itemBuilder: (c, index) { return _seletGatewayListListItem( 'images/controls_user.png', "您的钥匙已发送成功", "2023.6.21 11.15", () { // Navigator.pushNamed(context, Routers.gatewayConfigurationWifiPage); }); }), ); } Widget _seletGatewayListListItem(String lockTypeIcon, String gateWayName, String networkSignal, Function() action) { return GestureDetector( onTap: action, child: Container( height: 90.h, margin: const EdgeInsets.only(bottom: 2), // padding: // EdgeInsets.only(left: 10.w, right: 20.w, top: 20.h, bottom: 20.h), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(10.w), ), child: Row( children: [ SizedBox( width: 10.w, ), Image.asset( lockTypeIcon, width: 50.w, height: 50.w, ), SizedBox( width: 20.w, ), Expanded( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( gateWayName, style: TextStyle( fontSize: 22.sp, color: AppColors.blackColor), ), ], ), SizedBox(height: 5.h), Row( mainAxisAlignment: MainAxisAlignment.start, children: [ // Image.asset('images/mine/icon_mine_gatewaySignal_strong.png', width: 40.w, height: 40.w,), // SizedBox(width: 10.w,), Text( networkSignal, style: TextStyle( fontSize: 18.sp, color: AppColors.placeholderTextColor), ), ], ), SizedBox(width: 20.h), ], ), ) ], ), ), ); } }