|
|
@ -3,10 +3,12 @@ import 'dart:io';
|
|
|
|
|
|
|
|
|
|
|
|
// Project imports:
|
|
|
|
// Project imports:
|
|
|
|
import 'package:aku_new_community_manager/const/api.dart';
|
|
|
|
import 'package:aku_new_community_manager/const/api.dart';
|
|
|
|
|
|
|
|
import 'package:aku_new_community_manager/const/saas_api.dart';
|
|
|
|
import 'package:aku_new_community_manager/models/manager/inspection/inspection_point_submit_model.dart';
|
|
|
|
import 'package:aku_new_community_manager/models/manager/inspection/inspection_point_submit_model.dart';
|
|
|
|
import 'package:aku_new_community_manager/models/manager/inspection/inspection_qrcode_model.dart';
|
|
|
|
import 'package:aku_new_community_manager/models/manager/inspection/inspection_qrcode_model.dart';
|
|
|
|
import 'package:aku_new_community_manager/saas_models/net_model/base_model.dart';
|
|
|
|
import 'package:aku_new_community_manager/saas_models/net_model/base_model.dart';
|
|
|
|
import 'package:aku_new_community_manager/style/app_style.dart';
|
|
|
|
import 'package:aku_new_community_manager/style/app_style.dart';
|
|
|
|
|
|
|
|
|
|
|
|
// Flutter imports:
|
|
|
|
// Flutter imports:
|
|
|
|
import 'package:aku_new_community_manager/ui/manage_pages/inspection_manage/inspection_point_submit_page.dart';
|
|
|
|
import 'package:aku_new_community_manager/ui/manage_pages/inspection_manage/inspection_point_submit_page.dart';
|
|
|
|
import 'package:aku_new_community_manager/ui/manage_pages/inspection_manage/inspection_utils.dart';
|
|
|
|
import 'package:aku_new_community_manager/ui/manage_pages/inspection_manage/inspection_utils.dart';
|
|
|
@ -16,6 +18,7 @@ import 'package:aku_new_community_manager/ui/widgets/app_widgets/aku_single_chec
|
|
|
|
import 'package:aku_new_community_manager/ui/widgets/common/aku_button.dart';
|
|
|
|
import 'package:aku_new_community_manager/ui/widgets/common/aku_button.dart';
|
|
|
|
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
|
|
|
|
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
|
|
|
|
import 'package:aku_new_community_manager/utils/network/net_util.dart';
|
|
|
|
import 'package:aku_new_community_manager/utils/network/net_util.dart';
|
|
|
|
|
|
|
|
|
|
|
|
// Package imports:
|
|
|
|
// Package imports:
|
|
|
|
import 'package:bot_toast/bot_toast.dart';
|
|
|
|
import 'package:bot_toast/bot_toast.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
@ -29,6 +32,7 @@ import 'package:velocity_x/src/flutter/widgets.dart';
|
|
|
|
class InspectionPointInputPage extends StatefulWidget {
|
|
|
|
class InspectionPointInputPage extends StatefulWidget {
|
|
|
|
final InspectionQRCodeModel? qrModel;
|
|
|
|
final InspectionQRCodeModel? qrModel;
|
|
|
|
final String? inspectionName;
|
|
|
|
final String? inspectionName;
|
|
|
|
|
|
|
|
|
|
|
|
InspectionPointInputPage({Key? key, this.qrModel, this.inspectionName})
|
|
|
|
InspectionPointInputPage({Key? key, this.qrModel, this.inspectionName})
|
|
|
|
: super(key: key);
|
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
|
|
|
@ -42,6 +46,7 @@ class _InspectionPointInputPageState extends State<InspectionPointInputPage> {
|
|
|
|
InspectionQRCodeModel? _model;
|
|
|
|
InspectionQRCodeModel? _model;
|
|
|
|
List<File>? _selfPhotos;
|
|
|
|
List<File>? _selfPhotos;
|
|
|
|
List<File>? _scenePhots;
|
|
|
|
List<File>? _scenePhots;
|
|
|
|
|
|
|
|
|
|
|
|
bool get canSubmit {
|
|
|
|
bool get canSubmit {
|
|
|
|
if (_selfPhotos == null && _scenePhots == null) {
|
|
|
|
if (_selfPhotos == null && _scenePhots == null) {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -92,11 +97,12 @@ class _InspectionPointInputPageState extends State<InspectionPointInputPage> {
|
|
|
|
bottom: AkuButton(
|
|
|
|
bottom: AkuButton(
|
|
|
|
onPressed: canSubmit
|
|
|
|
onPressed: canSubmit
|
|
|
|
? () async {
|
|
|
|
? () async {
|
|
|
|
_submitModel.inspectionFaceImg = await NetUtil()
|
|
|
|
// _submitModel.inspectionFaceImg = await NetUtil()
|
|
|
|
.uploadFiles(_selfPhotos!, API.upload.uploadInspectionFace);
|
|
|
|
// .uploadFiles(_selfPhotos!, SAASAPI.upload.uploadImg);
|
|
|
|
|
|
|
|
_submitModel.inspectionFaceImg = [];
|
|
|
|
_submitModel.inspectionSpaceImg = await NetUtil().uploadFiles(
|
|
|
|
// _submitModel.inspectionSpaceImg = await NetUtil()
|
|
|
|
_scenePhots!, API.upload.uploadInspectionSpace);
|
|
|
|
// .uploadFiles(_scenePhots!, SAASAPI.upload.uploadImg);
|
|
|
|
|
|
|
|
_submitModel.inspectionSpaceImg = [];
|
|
|
|
BaseModel baseModel =
|
|
|
|
BaseModel baseModel =
|
|
|
|
await (ManageFunc.getSubmitPoint(_submitModel));
|
|
|
|
await (ManageFunc.getSubmitPoint(_submitModel));
|
|
|
|
if (baseModel.success) {
|
|
|
|
if (baseModel.success) {
|
|
|
|