| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325 |
- import 'package:deus_app/PhotoTool.dart';
- 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/page/repair/repair_job_device_list.dart';
- import 'package:flutter/material.dart';
- import 'package:flutter/services.dart';
- import 'package:wechat_assets_picker/wechat_assets_picker.dart';
- class RepairAddPage extends StatefulWidget {
- const RepairAddPage({super.key});
- @override
- State<StatefulWidget> createState() {
- return _RepairAddPage();
- }
- }
- class _RepairAddPage extends State<RepairAddPage> {
- int groupValue = 1;
- String note='',theme='';
- List<AssetEntity> imageFiles = [];
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: TitleBar().backAppbar("新建报修"),
- backgroundColor: const Color(0xfff2f2f2),
- body: Stack(children: [
- Column(
- children: [
- Expanded(
- // flex: 7,
- child: ListView(
- children: _Ws(),
- ),
- ),
- ],
- ),
- Positioned(
- left: 0,
- right: 0,
- bottom:0,
- // flex: 7,
- child:SizedBox(
- height: 50,
- width: double.infinity,
- child: TextButton(
- onPressed: () {
- },
- style: ButtonStyle(
- backgroundColor: MaterialStateProperty.all<Color>(
- Color(0xFF4875EC)),
- shape: MaterialStateProperty.all(
- BeveledRectangleBorder(
- borderRadius: BorderRadius.circular(0))),
- foregroundColor:
- MaterialStateProperty.all<Color>(Colors.white),
- ),
- child: const Text(ConstantString.submit),
- ),
- ),
- )
- ]));
- }
- List<Widget> _Ws() {
- List<Widget> ws = [];
- ws.add(_basicInformation());
- ws.add(_patrolAddTitle());
- // ws.add(_patrolAdd());
- ws.add(_notes());
- return ws;
- }
- Widget _notes(){
- return Container(
- child: Column(
- children: <Widget>[
- Container(
- height: 50,
- padding: EdgeInsets.only(left: 12),
- alignment: Alignment.centerLeft,
- child: Text('报修说明',style: TextStyle(
- color: Colors.black,
- fontSize: GSYConstant.TextSize15,
- )),
- ),
- Container(
- padding: EdgeInsets.only(left: 12,right: 12,bottom: 12),
- decoration: BoxDecoration(color: Colors.white),
- child: Column(
- children: [
- const SizedBox(
- height: 10,
- ),
- TextField(
- maxLines: 5,
- decoration: InputDecoration(border: OutlineInputBorder()),
- style: TextStyle(fontSize: 14),
- onChanged: (value) {
- note = value;
- },
- )
- ],
- ),
- ),
- Container(
- // padding: EdgeInsets.only(left: 12,right: 12),
- decoration: BoxDecoration(color: Colors.white),
- child: PhotoTool(imageCount: 5, lineCount: 5, addCall: (List<AssetEntity> _imageFiles){
- imageFiles.addAll(_imageFiles);
- }, removeCall:(int index){
- imageFiles.remove(index);
- }),
- )
- ],
- ),
- );
- }
- Widget _basicInformation() {
- return Column(children: [
- Container(
- height: 50,
- padding: EdgeInsets.only(left: 12),
- alignment: Alignment.centerLeft,
- child: const Text(
- '基本信息:',
- style: TextStyle(
- color: Colors.black,
- fontSize: GSYConstant.TextSize15,
- ),
- ),
- ),
- Container(
- color: Colors.white,
- padding: EdgeInsets.only(left: 12, right: 12),
- child: Column(
- children: [
- Row(
- children: [
- Text(
- '紧急程度:',
- style: TextStyle(
- color: GSYColors.primaryLightValue,
- fontSize: GSYConstant.TextSize15,
- ),
- ),
- Radio(
- value: 1,
- groupValue: groupValue,
- onChanged: (value) {
- // groupValue = value;
- setState(() {
- groupValue = value!;
- });
- },
- ),
- Text("一般",
- style: TextStyle(
- color: GSYColors.primaryLightValue,
- fontSize: GSYConstant.TextSize15,
- )),
- Radio(
- value: 2,
- groupValue: groupValue,
- onChanged: (value) {
- // groupValue = value;
- setState(() {
- groupValue = value!;
- });
- },
- ),
- Text("紧急",
- style: TextStyle(
- color: GSYColors.primaryLightValue,
- fontSize: GSYConstant.smallTextSize,
- ))
- ],
- ),
- const SizedBox(
- height: 10,
- ),
- Row(children: [
- Text(
- '报修主题:',
- style: TextStyle(
- color: GSYColors.primaryLightValue,
- fontSize: GSYConstant.TextSize15,
- ),
- ),
- const SizedBox(
- width: 15,
- ),
- Container(
- height: 40,
- width: MediaQuery.of(context).size.width / 2 +
- MediaQuery.of(context).size.width / 8,
- child: TextField(
- decoration: InputDecoration(
- border: OutlineInputBorder(),
- hintText: '请输入报修主题',
- contentPadding: EdgeInsets.only(
- bottom: 20, left: 10 // HERE THE IMPORTANT PART
- )),
- style: TextStyle(fontSize: 14),
- textAlignVertical: TextAlignVertical.center,
- textAlign: TextAlign.left,
- onChanged: (value) {
- theme=value;
- },
- ),
- )
- ]),
- const SizedBox(
- height: 10,
- ),
- ],
- ),
- )
- ]);
- }
- Widget _patrolAddTitle() {
- return Container(
- padding: EdgeInsets.fromLTRB(12, 0, 12, 0),
- height: 50,
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- const Text(
- '报修设备:',
- style: TextStyle(
- color: Colors.black,
- fontSize: GSYConstant.TextSize15,
- ),
- ),
- Container(
- child: TextButton(
- onPressed: () {
- Navigator.push(
- context,
- MaterialPageRoute(
- builder: (context) =>
- new RepairJobDeviceList()));
- },
- child: Row(
- children: [
- new Icon(Icons.add),
- new Text(
- '选择设备',
- style: TextStyle(
- color: Colors.blue,
- fontSize: GSYConstant.TextSize15,
- ),
- textAlign: TextAlign.right,
- )
- ],
- ),
- ),
- ),
- ],
- ),
- );
- }
- Widget _patrolAdd() {
- return Container(
- padding: EdgeInsets.only(top: 12, bottom: 12, left: 12, right: 12),
- color: Colors.white,
- child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
- Container(
- child: Text(
- '',
- style: const TextStyle(
- color: Colors.black,
- fontSize: GSYConstant.middleTextWhiteSize,
- fontWeight: FontWeight.bold,
- ),
- ),
- ),
- Container(
- padding: EdgeInsets.only(top: 3, bottom: 3, left: 5, right: 5),
- child: Text(""
- // equipmentVOS[index].status == 0
- // ? '在线'
- // : equipmentVOS[index].status == 1
- // ? '离线'
- // : equipmentVOS[index].status == 2
- // ? '未激活'
- // : '未知',
- // textAlign: TextAlign.right,
- // style: TextStyle(
- // color: equipmentVOS[index].status == 0
- // ? Colors.blue
- // : equipmentVOS[index].status == 1
- // ? Colors.orange
- // : equipmentVOS[index].status == 2
- // ? Colors.red
- // : Colors.black,
- // fontSize: GSYConstant.minTextSize,
- // ),
- ),
- // decoration: BoxDecoration(
- // border: new Border.all(
- // color: equipmentVOS[index].status == 0
- // ? Colors.blue
- // : equipmentVOS[index].status == 1
- // ? Colors.orange
- // : equipmentVOS[index].status == 2
- // ? Colors.red
- // : Colors.black, //边框颜色
- // width: 1.0, //边框粗细
- // ),
- // borderRadius: const BorderRadius.all(
- // const Radius.circular(3.0)), //边框的弧度
- // ),
- )
- ]),
- );
- }
- }
|