添加设施检查提交页面 修复高德地图兼容性问题导致闪退

hmxc
张萌 4 years ago
parent c336776930
commit 24b0c657ed

@ -9,7 +9,8 @@ import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
class FacilitiesCard extends StatefulWidget {
FacilitiesCard({Key key}) : super(key: key);
final int index;
FacilitiesCard({Key key, this.index}) : super(key: key);
@override
_FacilitiesCardState createState() => _FacilitiesCardState();
@ -25,9 +26,8 @@ class _FacilitiesCardState extends State<FacilitiesCard> {
children: [
'户外2号篮球场'.text.color(kTextPrimaryColor).size(32.sp).bold.make(),
Spacer(),
'待检查'
.text
.color(FacilitiesMap.insepectColor[1])
FacilitiesMap.inspectStatus[widget.index + 1].text
.color(FacilitiesMap.insepectColor[widget.index + 1])
.size(28.sp)
.bold
.make(),
@ -37,9 +37,10 @@ class _FacilitiesCardState extends State<FacilitiesCard> {
AkuDivider.horizontal(),
24.w.heightBox,
_buildTile(R.ASSETS_MANAGE_ADDRESS_PNG, '场地地址', '1号楼4单元门口'),
15.w.heightBox,
_buildTile(
R.ASSETS_MANAGE_CLOCK_PNG, '规定任务时间', '2020-10-1 19:00-20:300'),
..._midTile(),
...widget.index != 0
? []
: [
40.w.heightBox,
Row(
children: [
@ -47,7 +48,8 @@ class _FacilitiesCardState extends State<FacilitiesCard> {
AkuMaterialButton(
radius: 74.w,
height: 52.w,
padding: EdgeInsets.symmetric(vertical: 8.w, horizontal: 24.w),
padding: EdgeInsets.symmetric(
vertical: 8.w, horizontal: 24.w),
color: Color(0xFFFFC40C),
onPressed: () {
Get.to(() => FacilitiesInspectReportPage());
@ -61,6 +63,7 @@ class _FacilitiesCardState extends State<FacilitiesCard> {
],
),
],
],
)
.box
.width(double.infinity)
@ -73,6 +76,39 @@ class _FacilitiesCardState extends State<FacilitiesCard> {
});
}
_midTile() {
switch (widget.index) {
case 0:
return [
15.w.heightBox,
_buildTile(
R.ASSETS_MANAGE_CLOCK_PNG, '任务时间', '2020-10-1 19:00-20:300'),
];
case 1:
return [
15.w.heightBox,
_buildTile(R.ASSETS_MANAGE_CLOCK_PNG, '未完成原因', '超时',
color: Colors.red),
15.w.heightBox,
_buildTile(
R.ASSETS_MANAGE_CLOCK_PNG, '规定任务时间', '2020-10-1 19:00-20:300'),
];
case 2:
return [
15.w.heightBox,
_buildTile(R.ASSETS_MANAGE_CLOCK_PNG, '场地情况', '正常',
color: Color(0xFF3F8FFE)),
15.w.heightBox,
_buildTile(
R.ASSETS_MANAGE_CLOCK_PNG, '规定任务时间', '2020-10-1 19:00-20:300'),
15.w.heightBox,
_buildTile(R.ASSETS_MANAGE_CLOCK_PNG, '检查提交时间', '2020-10-1 19:00'),
];
default:
return [];
}
}
Widget _buildTile(String icon, String title, String text,
{Color color = kTextSubColor}) {
return Row(

@ -5,6 +5,7 @@ import 'package:aku_community_manager/style/app_style.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:aku_ui/common_widgets/aku_button.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
@ -28,14 +29,26 @@ class _FacilitiesInspectReportPageState
body: ListView(
children: [
_basicMessageCard(),
_descriptionCard('title', 0),
_descriptionCard('场地情况', 0),
_scenePhotoCard(),
_selfPhotoCard(),
],
),
bottom: _bottomSubmitButton(),
);
}
Widget _bottomSubmitButton() {
return AkuButton(
onPressed: () {},
width: double.infinity,
height: 100.w,
child: '立即提交'.text.color(kTextPrimaryColor).bold.size(32.sp).make(),
color: Color(0xFFFFC40C),
padding: EdgeInsets.symmetric(vertical: 26.w),
).pOnly(bottom: MediaQuery.of(context).padding.bottom);
}
Widget _basicMessageCard() {
return Column(
children: [
@ -85,6 +98,8 @@ class _FacilitiesInspectReportPageState
);
}
int _scene = 0;
Widget _descriptionCard(
String title,
int index,
@ -102,8 +117,9 @@ class _FacilitiesInspectReportPageState
AkuSingleCheckButton(
text: '正常',
value: 0,
gropValue: 1,
gropValue: _scene,
onPressed: () {
_scene = 0;
setState(() {});
},
),
@ -111,8 +127,9 @@ class _FacilitiesInspectReportPageState
AkuSingleCheckButton(
text: '异常',
value: 1,
gropValue: 2,
gropValue: _scene,
onPressed: () {
_scene = 1;
setState(() {});
},
),

@ -16,7 +16,9 @@ class _FacilitiesViewState extends State<FacilitiesView> {
return ListView(
padding: EdgeInsets.symmetric(vertical: 16.w, horizontal: 32.w),
children: [
FacilitiesCard(),
FacilitiesCard(
index: widget.index,
),
],
);
}

@ -49,7 +49,7 @@ class _BorrowItemDetailPageState extends State<BorrowItemDetailPage> {
return AkuScaffold(
title: '物品详情',
actions: [
userProvider.userInfoModel.role == USER_ROLE.MANAGER
userProvider.infoModel.canOperation
? AkuMaterialButton(
minWidth: 120.w,
onPressed: () async {
@ -138,7 +138,7 @@ class _BorrowItemDetailPageState extends State<BorrowItemDetailPage> {
_buildRow(
'出借状态',
Text(
'未出借',
_detailModel.borrowed ? '已出借' : '未出借',
style: TextStyle(
color: _isEditing
? AppStyle.minorTextColor

@ -28,8 +28,6 @@ class BorrowManagerCard extends StatefulWidget {
}
class _BorrowManagerCardState extends State<BorrowManagerCard> {
USER_ROLE get role =>
Provider.of<UserProvider>(context, listen: false).userInfoModel.role;
@override
Widget build(BuildContext context) {
return Container(

Loading…
Cancel
Save