修复 报事保修 派单提示未知错误的问题

升级dio库
hmxc
张萌 4 years ago
parent a1c941044c
commit d43be5986c

@ -13,6 +13,7 @@ import 'package:amap_map_fluttify/amap_map_fluttify.dart';
import 'package:get/get.dart' hide Response;
import 'package:hive/hive.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:jpush_flutter/jpush_flutter.dart';
import 'package:power_logger/power_logger.dart';
// Project imports:

@ -48,6 +48,8 @@ class _FixerDepartmentPageState extends State<FixerDepartmentPage> {
return false;
} else if (_reportModel.workOrderTypeDetail == -1) {
return false;
} else if (_reportModel.remark == null) {
return false;
}
return true;
}
@ -127,9 +129,9 @@ class _FixerDepartmentPageState extends State<FixerDepartmentPage> {
child: Text(
'立即派单',
style: TextStyle(
color: _pickedFixers.isEmpty
? AppStyle.minorTextColor
: AppStyle.primaryTextColor,
color: canDispatch
? AppStyle.primaryTextColor
: AppStyle.minorTextColor,
fontSize: 32.w,
fontWeight: FontWeight.bold,
),

@ -41,7 +41,7 @@ class ManageFunc {
///
static Future repairDispatch(DispatchReportModel model) async {
BaseModel baseModel =
await NetUtil().get(API.manage.repairDispatch, params: {
await NetUtil().post(API.manage.repairDispatch, params: {
'dispatchListId': model.dispatchListId,
'workOrderType': model.workOrderTyoe,
'workOrderTypeDetail': model.workOrderTypeDetail,

@ -34,14 +34,14 @@ class NetUtil {
);
if (_dio == null) _dio = Dio(options);
dio.interceptors.add(InterceptorsWrapper(
onRequest: (RequestOptions options) async => options,
onResponse: (Response response) async {
onRequest: (RequestOptions options,RequestInterceptorHandler handler) async => handler.next(options),
onResponse: (Response response,ResponseInterceptorHandler handler) async {
LoggerData.addData(response);
return response;
return handler.next(response);
},
onError: (DioError error) async {
onError: (DioError error,ErrorInterceptorHandler handler) async {
_parseErr(error);
return error;
return handler.next(error);
},
));
}
@ -154,17 +154,17 @@ class NetUtil {
}
switch (err.type) {
case DioErrorType.CONNECT_TIMEOUT:
case DioErrorType.SEND_TIMEOUT:
case DioErrorType.RECEIVE_TIMEOUT:
case DioErrorType.connectTimeout:
case DioErrorType.sendTimeout:
case DioErrorType.receiveTimeout:
_makeToast('连接超时');
break;
case DioErrorType.RESPONSE:
case DioErrorType.response:
_makeToast('服务器出错');
break;
case DioErrorType.CANCEL:
case DioErrorType.cancel:
break;
case DioErrorType.DEFAULT:
case DioErrorType.other:
_makeToast('未知错误');
break;
}

@ -79,7 +79,7 @@ packages:
name: auto_size_text
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0"
version: "3.0.0-nullsafety.0"
auto_size_text_pk:
dependency: transitive
description:
@ -205,21 +205,21 @@ packages:
name: device_info
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.0"
version: "2.0.0"
device_info_platform_interface:
dependency: transitive
description:
name: device_info_platform_interface
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.1"
version: "2.0.0"
dio:
dependency: "direct main"
description:
name: dio
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.10"
version: "4.0.0"
dotted_border:
dependency: "direct main"
description:
@ -287,7 +287,7 @@ packages:
name: flutter_highlight
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.6.0"
version: "0.7.0"
flutter_localizations:
dependency: "direct main"
description: flutter
@ -299,7 +299,7 @@ packages:
name: flutter_plugin_android_lifecycle
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.11"
version: "2.0.1"
flutter_rating_bar:
dependency: "direct main"
description:
@ -358,7 +358,7 @@ packages:
name: highlight
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.6.0"
version: "0.7.0"
hive:
dependency: "direct main"
description:
@ -379,28 +379,35 @@ packages:
name: http
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.2"
version: "0.13.1"
http_parser:
dependency: transitive
description:
name: http_parser
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.4"
version: "4.0.0"
image_picker:
dependency: "direct main"
description:
name: image_picker
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.6.7+12"
version: "0.7.4"
image_picker_for_web:
dependency: transitive
description:
name: image_picker_for_web
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
image_picker_platform_interface:
dependency: transitive
description:
name: image_picker_platform_interface
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.1"
version: "2.0.0"
import_sorter:
dependency: "direct dev"
description:
@ -493,7 +500,7 @@ packages:
name: package_info
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.4.3+4"
version: "2.0.0"
path:
dependency: transitive
description:
@ -542,7 +549,7 @@ packages:
name: pedantic
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.9.2"
version: "1.11.0"
permission_handler:
dependency: "direct main"
description:
@ -584,14 +591,7 @@ packages:
name: power_logger
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.3"
pretty_json:
dependency: transitive
description:
name: pretty_json
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
version: "1.0.1-nullsafety.1"
provider:
dependency: "direct main"
description:

@ -35,7 +35,7 @@ dependencies:
#验证码
pin_input_text_field: ^4.0.0
image_picker: ^0.6.7+12
image_picker: ^0.7.4
flutter_rating_bar: ^4.0.0
@ -49,9 +49,9 @@ dependencies:
velocity_x: ^2.6.0
dotted_border: ^2.0.0-nullsafety.0
dio:
dio: ^4.0.0
power_logger: ^0.1.3
power_logger: ^1.0.1-nullsafety.1
logger: ^1.0.0
aku_ui:
git:

Loading…
Cancel
Save