import 'package:deus_app/common/style/TitleBar.dart'; import 'package:deus_app/common/style/gsy_style.dart'; import 'package:deus_app/common/utils/ConstantString.dart'; import 'package:deus_app/widget/MyDrawer.dart'; import 'package:flutter/material.dart'; class DeviceManagePage extends StatefulWidget { static var routeName = '/DeviceManagePage'; const DeviceManagePage({super.key}); @override State createState() { return _DeviceManage(); } } class _DeviceManage extends State { String deviceNum = "0"; final GlobalKey _scaffoldKey = GlobalKey(); @override Widget build(BuildContext contexts) { return Scaffold( key: _scaffoldKey, appBar: TitleBar().drawAppBar(ConstantString.deviceManageText, () { _scaffoldKey.currentState?.openEndDrawer(); }), backgroundColor: const Color(0xfff2f2f2), endDrawer: MyDrawer(), //抽屉 body: Column( children: [ SizedBox( height: 10, ), Row( mainAxisAlignment:MainAxisAlignment.start, children: [ SizedBox( width: 15, ), Text(ConstantString.deviceNum, style: GSYConstant.smallActionLightText), Text(deviceNum, style: GSYConstant.normalTextBigWhiteBold), ], ), Expanded( child: Container( child: ListView.builder( itemCount: 20, itemBuilder: (context, index) { return Container( margin: EdgeInsets.only(top: 12, left: 10, right: 10), padding: EdgeInsets.only(top: 12, bottom: 10), color: Colors.white, child: ListTile( title: Column( children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( child: Text( '此处展示设备名称', style: TextStyle( color: Colors.black, fontSize: GSYConstant.middleTextWhiteSize, fontWeight: FontWeight.bold, ), ), ), Container( padding: EdgeInsets.only( top: 3, bottom: 3, left: 5, right: 5), child: Text( '运行中', textAlign: TextAlign.right, style: TextStyle( color: Colors.blue, fontSize: GSYConstant.minTextSize, ), ), decoration: BoxDecoration( border: new Border.all( color: Colors.blue, //边框颜色 width: 1.0, //边框粗细 ), borderRadius: const BorderRadius.all( const Radius.circular(3.0)), //边框的弧度 ), ) ]), SizedBox( height: 12, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( child: Text( 'devicekey:', style: TextStyle( color: GSYColors.primaryLightValue, fontSize: GSYConstant.middleTextWhiteSize, ), ), ), Container( child: Text( 'devicekey', textAlign: TextAlign.right, style: TextStyle( color: GSYColors.primaryLightValue, fontSize: GSYConstant.middleTextWhiteSize, ), ), ), ]), SizedBox( height: 10, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( child: Text( 'IMEI:', style: TextStyle( color: GSYColors.primaryLightValue, fontSize: GSYConstant.middleTextWhiteSize, ), ), ), Container( child: Text( 'IMEI', textAlign: TextAlign.right, style: TextStyle( color: GSYColors.primaryLightValue, fontSize: GSYConstant.middleTextWhiteSize, ), ), ), ]), SizedBox( height: 5, ), ], ), onTap: () { Scaffold.of(context).openEndDrawer(); }, )); }, ), )) ], ), ); } }