修复 巡检点详情进入白屏的问题

hmxc
张萌 4 years ago
parent 30df861640
commit 8b6a407d95

@ -7,6 +7,12 @@ class ImgModel {
ImgModel({this.url, this.size, this.longs, this.paragraph, this.sort});
static String first(List<ImgModel> models) {
if (models == null) return '';
if (models.isEmpty) return '';
return models.first.url;
}
ImgModel.fromJson(Map<String, dynamic> json) {
url = json['url'];
size = json['size'];

@ -1,3 +1,5 @@
import 'package:aku_community_manager/models/common/img_model.dart';
class InspectionCheckDetialModel {
int id;
int executeId;
@ -6,8 +8,8 @@ class InspectionCheckDetialModel {
int type;
String completeDate;
List<CheckFBIVoList> checkFBIVoList;
List<FaceImg> faceImg;
List<FaceImg> spaceImg;
List<ImgModel> faceImg;
List<ImgModel> spaceImg;
InspectionCheckDetialModel(
{this.id,
@ -34,15 +36,15 @@ class InspectionCheckDetialModel {
});
}
if (json['faceImg'] != null) {
faceImg = new List<FaceImg>();
faceImg = new List<ImgModel>();
json['faceImg'].forEach((v) {
faceImg.add(new FaceImg.fromJson(v));
faceImg.add(new ImgModel.fromJson(v));
});
}
if (json['spaceImg'] != null) {
spaceImg = new List<FaceImg>();
spaceImg = new List<ImgModel>();
json['spaceImg'].forEach((v) {
spaceImg.add(new FaceImg.fromJson(v));
spaceImg.add(new ImgModel.fromJson(v));
});
}
}

@ -415,6 +415,7 @@ class _InspectionManageDetailsPageState
hasScan: model.completeDate == null ? false : true,
executePointId: model.id,
executeName: _detailModel.name,
status: _detailModel.status,
));
});
}

@ -1,4 +1,5 @@
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/common/img_model.dart';
import 'package:aku_community_manager/models/manager/inspection/inspection_check_detail_model.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/manage_pages/inspection_manage/inspection_utils.dart';
@ -15,12 +16,14 @@ import 'package:velocity_x/velocity_x.dart';
class InspectionPointDetailPage extends StatefulWidget {
final int executePointId;
final String executeName;
final hasScan;
final bool hasScan;
final int status;
InspectionPointDetailPage({
Key key,
this.executePointId,
this.executeName,
@required this.hasScan,
this.status,
}) : super(key: key);
@override
@ -109,7 +112,7 @@ class _InspectionPointDetailPageState extends State<InspectionPointDetailPage> {
child: FadeInImage.assetNetwork(
fit: BoxFit.fill,
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(_detialModel.faceImg?.first?.url ?? '')),
image: API.image(ImgModel.first(_detialModel.faceImg))),
)
: DottedBorder(
borderType: BorderType.RRect,
@ -161,7 +164,7 @@ class _InspectionPointDetailPageState extends State<InspectionPointDetailPage> {
child: FadeInImage.assetNetwork(
fit: BoxFit.fill,
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(_detialModel.spaceImg?.first?.url ?? '')),
image: API.image(ImgModel.first(_detialModel.spaceImg))),
)
: DottedBorder(
borderType: BorderType.RRect,
@ -330,6 +333,12 @@ class _InspectionPointDetailPageState extends State<InspectionPointDetailPage> {
fontSize: 36.sp,
fontWeight: FontWeight.bold),
),
Spacer(),
InspectionUtils.status[widget.status].text
.color(InspectionUtils.color(widget.status))
.bold
.size(28.sp)
.make()
],
),
),

Loading…
Cancel
Save