添加 巡检点信息填写页面

添加 巡检点信息提交成功页面
添加 巡检管理通用组件
添加 照片选择组件
添加 方形单选按钮组件
添加 虚线边框依赖库
添加 部分icon
hmxc
张萌 4 years ago
parent 9d14c37c82
commit e743c55541

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

@ -0,0 +1,419 @@
import 'dart:io';
import 'package:aku_community_manager/models/manager/inspection/inspection_detail_model.dart';
import 'package:aku_community_manager/models/manager/inspection/inspection_point_model.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/manage_pages/inspection_manage/inspection_utils.dart';
import 'package:aku_community_manager/ui/widgets/app_widgets/aku_pick_image_widget.dart';
import 'package:aku_community_manager/ui/widgets/app_widgets/aku_single_check_button.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class InspectionPointInputPage extends StatefulWidget {
final bool hasScan;
final InspectionDetailModel detailModel;
final int inspectionStatus;
final InspectionPointModel pointModel;
InspectionPointInputPage(
{Key key,
this.hasScan,
this.detailModel,
this.inspectionStatus,
this.pointModel})
: super(key: key);
@override
_InspectionPointInputPageState createState() =>
_InspectionPointInputPageState();
}
class _InspectionPointInputPageState extends State<InspectionPointInputPage> {
TextEditingController _cleaningExtraController;
TextEditingController _meterExtraController;
TextEditingController _meterCountContrlller;
int _cleaningStatus;
int _meterStatus;
File _selfPhoto;
File _scenePhoto;
@override
void initState() {
super.initState();
_cleaningExtraController = TextEditingController();
_meterExtraController = TextEditingController();
_meterCountContrlller = TextEditingController();
}
@override
void dispose() {
_cleaningExtraController?.dispose();
_meterExtraController?.dispose();
_meterCountContrlller?.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '巡检点',
body: ListView(
children: [
16.w.heightBox,
_inspectionHeadCard(),
16.w.heightBox,
_cleaningCard(),
_meterCard(),
_selfPhotoCard(),
_scenePhotoCard(),
],
),
);
}
Widget _scenePhotoCard() {
return Column(
children: [
Row(
children: [
'3.巡更人员自拍人脸'.text.color(kTextPrimaryColor).size(32.sp).bold.make()
],
),
32.w.heightBox,
AkuPickImageWidget(
onChanged: (file) {
_scenePhoto = file;
},
),
],
).box.color(Colors.white).make();
}
Widget _selfPhotoCard() {
return Column(
children: [
Row(
children: [
'3.巡更人员自拍人脸'.text.color(kTextPrimaryColor).size(32.sp).bold.make()
],
),
32.w.heightBox,
AkuPickImageWidget(
onChanged: (file) {
_selfPhoto = file;
},
),
],
).box.color(Colors.white).make();
}
Widget _meterCard() {
return Column(
children: [
Row(
children: [
'2.检查小区南门抄表数据'.text.color(kTextPrimaryColor).size(32.sp).make()
],
),
32.w.heightBox,
Row(
children: [
AkuSingleCheckButton(
text: '正常',
value: 0,
gropValue: _meterStatus,
onPressed: () {
_cleaningStatus = 0;
},
),
80.w.widthBox,
AkuSingleCheckButton(
text: '异常',
value: 0,
gropValue: _meterStatus,
onPressed: () {
_cleaningStatus = 1;
},
),
],
),
36.w.heightBox,
Row(
children: [
'抄表值'.text.color(kTextPrimaryColor).size(28.sp).make(),
Spacer(),
TextField(
controller: _meterCountContrlller,
textAlign: TextAlign.end,
inputFormatters: [
FilteringTextInputFormatter.allow(RegExp('[0-9]*'))
],
decoration: InputDecoration(
border: InputBorder.none,
hintText: '请输入抄表值',
hintStyle: TextStyle(
fontSize: 28.sp,
color: kTextSubColor,
),
contentPadding: EdgeInsets.zero,
isDense: true,
),
)
],
),
28.w.heightBox,
Divider(),
Container(
width: 686.w,
height: 120.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
border: Border.all(
width: 2.w,
color: Color(0xFFE8E8E8),
),
),
child: TextField(
minLines: 5,
controller: _meterExtraController,
decoration: InputDecoration(
hintText: '请输入备注信息',
hintStyle: TextStyle(
fontSize: 28.sp,
color: kTextSubColor,
),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
isDense: true,
),
),
),
],
)
.box
.padding(EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w))
.color(Colors.white)
.make();
}
Widget _cleaningCard() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
'1.${widget.pointModel.name}'.text.black.size(32.sp).bold.make()
],
),
32.w.heightBox,
Row(
children: [
AkuSingleCheckButton(
text: '正常',
value: 0,
gropValue: _cleaningStatus,
onPressed: () {
_cleaningStatus = 0;
},
),
80.w.widthBox,
AkuSingleCheckButton(
text: '异常',
value: 0,
gropValue: _cleaningStatus,
onPressed: () {
_cleaningStatus = 1;
},
),
],
),
32.w.heightBox,
Container(
width: 686.w,
height: 120.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
border: Border.all(
width: 2.w,
color: Color(0xFFE8E8E8),
),
),
child: TextField(
minLines: 5,
controller: _cleaningExtraController,
decoration: InputDecoration(
hintText: '请输入备注信息',
hintStyle: TextStyle(
fontSize: 28.sp,
color: kTextSubColor,
),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
isDense: true,
),
),
),
],
)
.box
.color(Colors.white)
.padding(EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w))
.make();
}
Widget _inspectionHeadCard() {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
16.w.heightBox,
Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 24.w, right: 24.w, bottom: 40.w),
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
color: Color(0xFFFFFFFF)),
child: Column(children: [
Container(
height: 86.w,
width: double.infinity,
alignment: Alignment.centerLeft,
child: Row(
children: [
Text(
'${widget.detailModel.name}',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 36.sp,
fontWeight: FontWeight.bold),
),
Spacer(),
InspectionUtils.status[widget.inspectionStatus].text
.color(InspectionUtils.color(widget.inspectionStatus))
.bold
.size(28.sp)
.make()
],
),
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(
R.ASSETS_MANAGE_IC_RENWU_PNG,
width: 40.w,
height: 40.w,
),
4.w.widthBox,
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
'巡检名称',
style: InspectionUtils.textstyle,
),
],
),
36.w.widthBox,
Text(
widget.detailModel.name,
maxLines: 2,
textAlign: TextAlign.right,
style: AppStyle().primaryStyle,
).expand()
],
),
12.w.heightBox,
Row(
children: [
Image.asset(
R.ASSETS_MANAGE_IC_RENWU_PNG,
width: 40.w,
height: 40.w,
),
4.w.widthBox,
Text(
'巡检编号',
style: InspectionUtils.textstyle,
),
Spacer(),
Text(
widget.detailModel.code,
style: AppStyle().primaryStyle,
)
],
),
12.w.heightBox,
Row(
children: [
Image.asset(
R.ASSETS_INSPECTION_IC_XUNJIAN_PNG,
width: 40.w,
height: 40.w,
),
4.w.widthBox,
Text(
'规定巡检时间',
style: InspectionUtils.textstyle,
),
Spacer(),
Text(
'${DateUtil.formatDateStr(widget.detailModel.beginDate, format: "yyyy-MM-dd HH:mm")}${widget.detailModel?.endDate == null ? '' : DateUtil.formatDateStr(widget.detailModel.endDate, format: "HH:mm")}',
style: AppStyle().primaryStyle,
),
],
),
12.w.heightBox,
...widget.detailModel?.actualBeginDate == null
? <Widget>[SizedBox()]
: [
Row(
children: [
Image.asset(
R.ASSETS_MANAGE_IC_TIME_PNG,
width: 40.w,
height: 40.w,
),
4.w.widthBox,
Text(
'开始巡检时间',
style: InspectionUtils.textstyle,
),
Spacer(),
Text(
'${DateUtil.formatDateStr(widget.detailModel.actualBeginDate, format: "yyyy-MM-dd HH:mm")}',
style: AppStyle().primaryStyle,
),
],
),
12.w.heightBox,
],
widget.detailModel?.actualEndDate == null
? SizedBox()
: Row(
children: [
Image.asset(
R.ASSETS_MESSAGE_IC_PEOPLE_PNG,
width: 40.w,
height: 40.w,
),
4.w.widthBox,
Text(
'结束巡检时间',
style: InspectionUtils.textstyle,
),
Spacer(),
Text(
'${DateUtil.formatDateStr(widget.detailModel.actualEndDate, format: "yyyy-MM-dd HH:mm")}',
style: AppStyle().primaryStyle,
),
],
)
]),
),
],
);
}
}

@ -0,0 +1,58 @@
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_ui/aku_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
class InspectionPointSubmitPage extends StatefulWidget {
InspectionPointSubmitPage({Key key}) : super(key: key);
@override
_InspectionPointSubmitPageState createState() =>
_InspectionPointSubmitPageState();
}
class _InspectionPointSubmitPageState extends State<InspectionPointSubmitPage> {
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '巡检点',
body: Center(
child: Container(
width: double.infinity,
child: Column(
children: [
Image.asset(R.ASSETS_MANAGE_SUBMIT_SUCCESS_PNG,
width: 587.w, height: 350.w),
'提交成功'.text.black.size(40.sp).bold.make(),
8.w.heightBox,
'感谢您的努力工作,为小区安全做出贡献'
.text
.color(kTextSubColor)
.size(26.sp)
.bold
.make(),
80.w.heightBox,
AkuButton(
color: kPrimaryColor,
child: '继续巡更'
.text
.color(kTextPrimaryColor)
.size(32.sp)
.bold
.make(),
radius: 8.w,
padding: EdgeInsets.symmetric(vertical: 22.w, horizontal: 76.w),
onPressed: () {
Get.back();
},
),
],
),
),
),
);
}
}

@ -0,0 +1,24 @@
import 'package:aku_community_manager/style/app_style.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class InspectionUtils {
static TextStyle textstyle =
TextStyle(color: AppStyle.minorTextColor, fontSize: 28.sp);
static Map<int, String> status = {1: '待巡检', 2: '已巡检', 3: '巡检中', 4: '未巡检'};
static Color color(int status) {
switch (status) {
case 1:
return Color(0xFFFF4501);
break;
case 2:
return Color(0xFF999999);
case 3:
return Color(0xFFFF4501);
case 4:
return Color(0xFFFF4501);
default:
return Colors.blue;
}
}
}

@ -0,0 +1,53 @@
import 'dart:io';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/widgets/inner/pick_image.dart';
import 'package:dotted_border/dotted_border.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:aku_community_manager/const/resource.dart';
import 'package:velocity_x/velocity_x.dart';
class AkuPickImageWidget extends StatefulWidget {
final double size;
final Function(File file) onChanged;
AkuPickImageWidget({Key key, this.size, this.onChanged}) : super(key: key);
@override
_AkuPickImageWidgetState createState() => _AkuPickImageWidgetState();
}
class _AkuPickImageWidgetState extends State<AkuPickImageWidget> {
File _file;
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () async {
await akuPickImage().then((value) => _file = File(value.path));
widget.onChanged(_file);
},
child: DottedBorder(
color: Color(0xFF999999),
strokeWidth: 2.w,
radius: Radius.circular(8.w),
child: Container(
width: widget.size ?? 160.w,
height: widget.size ?? 160.w,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
R.ASSETS_MANAGE_IC_IMAGE_PNG,
width: 60.w,
height: 60.w,
),
4.w.heightBox,
'上传图片'.text.color(kTextSubColor).size(22.sp).bold.make(),
],
),
),
).material(color: Colors.transparent),
);
}
}

@ -0,0 +1,41 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class AkuSingleCheckButton<T> extends StatefulWidget {
final String text;
final T value;
final T gropValue;
final VoidCallback onPressed;
AkuSingleCheckButton(
{Key key, this.text, this.value, this.gropValue, this.onPressed})
: super(key: key);
@override
_AkuSingleCheckButtonState createState() => _AkuSingleCheckButtonState();
}
class _AkuSingleCheckButtonState extends State<AkuSingleCheckButton> {
bool get isSelect => widget.value == widget.gropValue;
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: isSelect ? Color(0xFFFFF8E0) : Colors.white,
border: Border.all(
color: isSelect ? Color(0xFFFFC40C) : Color(0xFF999999),
width: 3.w),
borderRadius: BorderRadius.circular(4.w)),
width: 180.w,
height: 72.w,
child: widget.text.text
.color(isSelect ? Color(0xFF999999) : Color(0xFF333333))
.bold
.size(32.sp)
.make(),
).onInkTap(() {
widget.onPressed();
setState(() {});
});
}
}

@ -220,6 +220,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.10"
dotted_border:
dependency: "direct main"
description:
name: dotted_border
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0-nullsafety.0"
expandable:
dependency: "direct main"
description:
@ -494,6 +501,20 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.0"
path_drawing:
dependency: transitive
description:
name: path_drawing
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.5.0-nullsafety.0"
path_parsing:
dependency: transitive
description:
name: path_parsing
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.0-nullsafety.0"
path_provider:
dependency: transitive
description:

@ -48,7 +48,7 @@ dependencies:
permission_handler: ^5.0.1+1
velocity_x: ^2.6.0
dotted_border: ^2.0.0-nullsafety.0
dio:
power_logger: ^0.1.3

Loading…
Cancel
Save