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 SelectBranchPage extends StatefulWidget { const SelectBranchPage({Key? key}) : super(key: key); @override State createState() => _SelectBranchPageState(); } class _SelectBranchPageState extends State { @override Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( barTitle: TranslationLoader.lanKeys!.recipientInformation!.tr, haveBack: true, backgroundColor: AppColors.mainColor, ), body: Column( children: [ _buildTopView(), SizedBox( height: 20.h, ), Expanded(child: _buildMainUI()), _buildNextBtn(), SizedBox( height: 64.h, ) ], ), ); } Widget _buildTopView() { return Container( height: 120.h, width: ScreenUtil().screenWidth, color: Colors.white, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: EdgeInsets.only(left: 40.w, top: 20.h, bottom: 16.h), child: Text( '公寓', style: TextStyle(fontSize: 28.sp), ), ), Padding( padding: EdgeInsets.only(left: 40.w), child: Text('管理员:18682150237', style: TextStyle( color: AppColors.darkGrayTextColor, fontSize: 24.sp)), ) ], ), ); } Widget _buildMainUI() { return ListView.separated( itemCount: 5, separatorBuilder: (context, index) { return Divider( height: 1, indent: 20.w, endIndent: 20.w, color: AppColors.greyLineColor, ); }, itemBuilder: (c, index) { return _electronicKeyItem('images/select_circle.png', "分组一", () {}); }); } Widget _electronicKeyItem( String leftIcon, String leftTitle, Function() action) { return GestureDetector( child: Container( color: Colors.white, height: 70.h, child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox( width: 40.w, ), GestureDetector( child: Image.asset( leftIcon, width: 16, height: 16, ), ), SizedBox( width: 16.w, ), Text( leftTitle, style: TextStyle(fontSize: 28.sp), ) ], ), ), onTap: () {}, ); } Widget _buildNextBtn() { return GestureDetector( child: Container( color: AppColors.mainColor, width: ScreenUtil().screenWidth, height: 64.h, child: TextButton( onPressed: () {}, child: Text( '下一步', style: TextStyle(fontSize: 28.sp, color: Colors.white), )), ), ); } }